Hi all,
using a python generator as a source for another python generator can be helpful for prototyping. But I'm having trouble getting the cache of the child generator.
GetCache always returns me "None", and using current state to object also returns "None".
This is a code sample:
def main():
obj = op.GetDown().GetClone()
print obj.GetCache()
return obj
I tried to see if it has children or siblings with GetDown or GetNext but I get:
"AttributeError: 'NoneType' object has no attribute 'GetDown'"
Code with current state to object:
def currentState(obj) :
return c4d.utils.SendModelingCommand(c4d.MCOMMAND_CURRENTSTATETOOBJECT,[obj],c4d.MODELINGCOMMANDMODE_ALL,c4d.BaseContainer(),doc)[0]
def main():
obj = op.GetDown().GetClone()
collapsed = currentState(obj)
print collapsed.GetChildren() //returns []
return collapsed
In the docs there is a recursion function for the cache but I'm not sure how to use it.
I'm trying to understand what I'm doing wrong, are there suggestions on how to achieve this?
Here is a sample file:
python_under_python.c4d