On 05/04/2016 at 13:47, xxxxxxxx wrote:
Hello all,
I keep getting crashes on particular objects when I run the GetCache() method outlined in the sdk (pasted below for convenient reference). The worst offender seems to be this polygon object with a few deformers, one of them being the mesh deformer--though I don't know if it has anything to do with the object or if I'm actually calling it incorrectly (just from the script manager, at the moment).
Anyway, I started going the send modeling command route, ie:
surface2list = [geo]
settings = c4d.BaseContainer()
settings.SetBool(c4d.MDATA_CURRENTSTATETOOBJECT_INHERITANCE, True)
polysurface = c4d.utils.SendModelingCommand(c4d.MCOMMAND_CURRENTSTATETOOBJECT, surface2list, bc=settings, doc=doc)
It works, so I guess my question is: is this (the send modeling command) bad practice for any particular reason/should I find out how to properly utilize the cache method, instead? I'm sure I've seen this used before in a recent search, but in my case it will go through every frame and run the conversion every time (sometimes on more than one object) to get the point info it needs. Does that all make sense?
Here's the cache method from the sdk I was talking about, though I'm sure most of you know what I meant.
def DoRecursion(op) :
tp = op.GetDeformCache()
if tp is not None:
DoRecursion(tp)
else:
tp = op.GetCache()
if tp is not None:
DoRecursion(tp)
else:
if not op.GetBit(c4d.BIT_CONTROLOBJECT) :
if op.IsInstanceOf(c4d.Opolygon) :
...
tp = op.GetDown()
while tp is not None:
DoRecursion(tp)
tp = tp.GetNext()
Thanks for any advice!