I'm developing generator plugin over child polygon objects.
It works good with GetAndCheckHierarchyClone + CurrentStateToObjectCommand which might have regular deformers underneath.
But it doesn't work with children with applied dynamics to them.
If it GetDeformCache() + GetCache() - maybe there's an example exist?
I found it's because of OBJECT_INPUT flag. Single OBJECT_GENERATOR flag is allowing children to have dynamics...
However original objects are observable in the viewport for a fraction of the second every frame update.
Also Make Editable and Current State to Object applied to the generator contains generated + original objects in the null.
How to get same experience as built-in generators, where no source objects are visible, and children dynamics is supported?
Hi @baca, you are right you should remove the OBJECT_INPUT but this imply you need to handle them correctly.
I'm not able to reproduce the delay you mention here my code
def GetVirtualObjects(self, op, hierarchyhelp):
orig = op.GetDown()
if orig is None:
dirty = False
trans = c4d.AliasTrans()
if not trans or not trans.Init(op.GetDocument()):
dic = op.GetAndCheckHierarchyClone(hierarchyhelp, orig, c4d.HIERARCHYCLONEFLAGS_ASPOLY, True, trans)
if not dic["dirty"]:
if not dic["clone"]:
main = None
clone = dic["clone"]
main = clone
main = c4d.BaseObject(c4d.Onull)
Hi @m_adam ,
Adding Touch() is removing visibility of original object, but dynamics stop to work on children after that
BTW, your code throw error:
hierarchy_clone = op.GetAndCheckHierarchyClone(hierarchyhelp, orig, c4d.HIERARCHYCLONEFLAGS_ASPOLY, True, trans)
TypeError: an integer is required
Scene file test_generator.c4d
Generator plugin test_generator.zip