On 25/09/2017 at 16:42, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R18
Platform: Windows ;
Language(s) : C++ ;
---------
Hi All!
I have found an unpleasant thing.
R18 crashes if I compute normals = pobj->CreatePhongNormals(); when running on a background thread.
There was document clone (via GetClone), then started a background thread, then called doc_clone->ExecutePasses on the new thread. Then parsed the cloned doc and reached the call normals = pobj->CreatePhongNormals(); And this call for normals calculations crashes Cinema if the object has more than 8192 polygons (the number is something like that). E.g. create a sphere with 128 segments and it will crash. If there are say 120 segments on the sphere it doesn't crash.
If I comment the line with "normals = pobj->CreatePhongNormals();" then there is no crash. And e.g. there is also no crash on R17 for the same code. Without this background thread (running on Main thread) everything is fine on R18 too.
It seems like there is no enogh memory inside CreatePhongNormals for objects with more than ~8K polygons. How to fix that?
I can also add that the background thead where these thing is running is std::thread. Haven't yet tried with C4DThread. Does that make any sense?
Please help me to fix the issue.
Thanks,
Aaron