On 02/12/2015 at 15:05, xxxxxxxx wrote:
Cinema 4D Version: R17
Platform: Windows ;
Language(s) : C++ ;
I am trying to implement a renderer and i need to convert the whole hierarchy to polygons.
What i do right know is to traverse the hierarchy and make everything editable using MCOMMAND_MAKEEDITABLE.
That way i need to take care of the links (instance, Moinstance, Splire Wrapper , etc), because in some cases they break (depending on where they point to).
Even though it works, the way i have implemented it seems way too complex.
- Is there any better way to do this ?
Also, this procedure doesn't work for emitter that emit objects (e.g. spheres).
I have seen in the forum that GetDeformCache returns a polygonized object (if the cache is built previously with a Hierarchy subclass).
2) Is it safe to use insertObject to added to the document afterwards ?
Sometimes i cannot use the Hierarchy class to build the caches.
So i try to use the following code:
cache = object->GetCache();
deform_cache = cache->GetDeformCache();
After that i clone deform_cache and use InsertObject to add it to the document.
For primitives it works, but for clones it doesn't (GetDeformCache returns NULL).
3) How can i get the deform cache without using Hierarchy class ?
My purpose is to polygonize the whole scene.
4) Which is the best way to do it ?
Sorry if I am asking something obvious but my knowledge and experience in C4D C++ SDK is limited.
Thank you for your time.