Hi Manuel,
Thanks for your response. I'm loading the scene directly from a .c4d file as follows (with src being the path to the c4d file):
load = documents.LoadFile(src)
if not load:
return False
self.doc = documents.GetActiveDocument()
if self.doc is None:
return False
Up to this point, everything works as expected. If I print a list of all objects, the Cloner object is there. However, when I export the scene as an FBX, the Cloner object is missing. I had a look at the thread you linked and experimented with the different export flags, but it didn't seem to have any effect regarding the Cloner issue. Here's the full code for my export method:
FBX_EXPORTER_ID = 1026370
def Export(self):
objs = GetAllObjects(self.doc.GetFirstObject(), [])
for obj in objs:
print obj.GetName(), "-", obj.GetType() # the cloner is still here at this point
plug = c4d.plugins.FindPlugin(FBX_EXPORTER_ID, c4d.PLUGINTYPE_SCENESAVER)
if plug is None:
return
# Get a path to save the exported file
filePath = self.dst
if filePath is None:
return
op = {}
if plug.Message(c4d.MSG_RETRIEVEPRIVATEDATA, op):
print op
if "imexporter" not in op:
return
# BaseList2D object stored in "imexporter" key hold the settings
fbxExport = op["imexporter"]
if fbxExport is None:
return
# set export flags
fbxExport[c4d.FBXEXPORT_CLONE_OBJECTS] = True
fbxExport[c4d.FBXEXPORT_LIGHTS] = True
fbxExport[c4d.FBXEXPORT_SPLINES] = True
fbxExport[c4d.FBXEXPORT_LIGHTS] = True
fbxExport[c4d.FBXEXPORT_TRACKS] = True
fbxExport[c4d.FBXEXPORT_TRIANGULATE] = True
fbxExport[c4d.FBXEXPORT_INSTANCES] = True
fbxExport[c4d.FBXEXPORT_SUBSTANCES] = True
fbxExport[c4d.FBXEXPORT_SAVE_NORMALS] = True
fbxExport[c4d.FBXEXPORT_EMBED_TEXTURES] = True
fbxExport[c4d.FBXEXPORT_TEXTURES] = True
# export without dialogs
return documents.SaveDocument(self.doc, filePath, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, FBX_EXPORTER_ID)
This works fine for other c4d files that do not contain any Cloner objects. I'm on R21 Trial at the moment, by the way.