On 23/12/2014 at 17:34, xxxxxxxx wrote:
Are there any alternatives to GetDeformCache() in Python?
I need to access the deformed geometry of a polygon object (after deformers such as Skin and MSkin have been executed), but GetDeformCache() isn't guaranteed to return anything anytime. In practice, this generally means that anything calling GetDeformCache() right after scene load will receive None instead of a valid object (which you can work around, but having your plugin "wait" for GDC to return something breaks network rendering and causes some really strange delayed viewport performance).
I'm aware that the documentation says I should call SendModelingCommand() instead with c4d.MCOMMAND_CURRENTSTATETOOBJECT, but this seems to clone the targeted geometry in RAM and I would rather not do that since the objects I'm trying to access the deform cache for can be quite large (so 60 plugin instances accessing the same object means that object is cloned 60 times).
What should I do to access the deformed geometry in a safe and predictable manner? Is CSTO really my only option? I've thought about splitting my plugin into two parts (a "fake deformer" that processes the geometry, and several auxiliary objects that act upon the processed data) but this too seems like a fairly dirty kludge.
-CMPX