I want to store an object and its children into a external file using following script.
import c4d from c4d import gui # Main function def main(): sel = doc.GetSelection() newDoc = c4d.documents.IsolateObjects(doc, sel) c4d.documents.SaveDocument(newDoc, "isolated_objects.c4d", 0, c4d.FORMAT_C4DEXPORT) c4d.EventAdd # Execute main() if __name__=='__main__': main()
However, if I try to export following object with its children (I selected all objects manually),
the hierarchy is not correct and also the original objects are in the scene file?
What am I doing incorrect?
Is it because the selection is incorrect, not taking into account the hierarchy.
If so, how can I select the objects and its children withthe correct hierarchy?