Hi Zipit, thanks for the reply.
The Optimized Cache is off.
I isolated the dirty check code since I couldn't get that part to work.
Your example works for a child, if I replace it with a link as in my case, then it doesn't work.
def main():
linked_object = op[c4d.ID_USERDATA,2]
# No linked object
if linked_object is None:
return c4d.BaseList2D(c4d.Onull)
# Return the linked object if it is dirty or if op has not build any caches yet.
if linked_object.IsDirty(c4d.DIRTYFLAGS_ALL) or op.GetCache() is None:
# Consume the dirty flag of the linked object.
linked_object.Touch()
# Get a clone of the linked object, as we cannot insert the same node twice
# into the document (Cinema has a mono-hierarchical graph).
clone = linked_object.GetClone(c4d.COPYFLAGS_NO_HIERARCHY)
# Center / align the clone to the Python generator object.
clone.SetMg(c4d.Matrix())
print "Build cache"
return clone
# Otherwise return the cache.
else:
#print "Returned cache"
return op.GetCache()
Maybe the python generator can only dirty check its children? Or perhaps the links need special handling?