SOLVED fbx export plugin critical error

Hi, im running the fbx-export plugin from within cinema4d r21 and run into a bug.

documents.SaveDocument(doc, c4dPath, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, c4d.FORMAT_C4DEXPORT)

saved_document =  documents.SaveDocument(doc, filePath, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, FBX_EXPORTER_ID)

While it works fine manually using my chosen settings, it throws a critical error while called from the commandline.

CRITICAL: Stop [exporttree.cpp(1908)]

The parameters are identical.

# Define the settings
			fbxExport[c4d.FBXEXPORT_FBX_VERSION] = c4d.FBX_EXPORTVERSION_7_4_0
			fbxExport[c4d.FBXEXPORT_FLIP_Z_AXIS] = False
			fbxExport[c4d.FBXEXPORT_UP_AXIS] = c4d.FBXEXPORT_UP_AXIS_Y 
			fbxExport[c4d.FBXEXPORT_ASCII] = False
			fbxExport[c4d.FBXEXPORT_CLONE_OBJECTS] = True
			fbxExport[c4d.FBXEXPORT_LIGHTS] = True
			fbxExport[c4d.FBXEXPORT_SPLINES] = False
			fbxExport[c4d.FBXEXPORT_TRACKS] = True
			fbxExport[c4d.FBXEXPORT_INSTANCES] = True
			fbxExport[c4d.FBXEXPORT_SUBSTANCES] = False
			fbxExport[c4d.FBXEXPORT_SAVE_NORMALS] = True
			fbxExport[c4d.FBXEXPORT_EMBED_TEXTURES] = True
			fbxExport[c4d.FBXEXPORT_TEXTURES] = True
			fbxExport[c4d.FBXEXPORT_CAMERAS] = False
			fbxExport[c4d.FBXEXPORT_SDS] = True
			fbxExport[c4d.FBXEXPORT_SDS_SUBDIVISION] = True
			fbxExport[c4d.FBXEXPORT_SELECTION_ONLY] = False

The file is identical.
Ive searched online for the error, but i couldnt find a solution. Do you have a github repo were one could join the organization and look further into it?
Im sorry for any typos, i have a deadline on friday and a regression.

Have a nice evening you all.

So it turns out i somehow destroyed my cinema4d Install using the python API. I reinstalled it and added all plugins. And it worked.
'''
for i in range(1,1000)
c4d.CallCommand(myPluginID + i)
'''
For reverse engineering is considered harmful.

I'd be pretty concerned, if it's possible to destroy the C4D via the Python API (as long as I do not do any explicit file access on any installation files). If you can somehow reproduce it or at least have an idea, in which area of the API to look out for such dangers, I'd be grateful.

So, yes, i can reproduce it.. and the error is pretty embarassing, though not obvious.. First the scenetree error is not related to this. At all. It was thus:
I checked ahead of time wether the path to export to exists. For this i used makedir.. and foolishly the whole filePath.
The result was the seeming fail to create a fbx. The reason being that the mkdir seems to create some horrible directory thing:
That is killed it seems, but not fast enough for the fbx exporter to bump into it.

In summary it works: If you do not throw a wrench into it via python file system. Its hard to debug though, as there is no indicator, but a flickering /fbx/ folder that appears for a moment.

hi,

I would say that calling randomly plugin command can be dangerous yes.
I would also point out that reverse engineering is forbidden in most of the cases.

So, your problem is solved?

Cheers,
Manuel

@FSS Thanks for your looking into it and your explanation.

Hello @FSS,

without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022.

Thank you for your understanding,
Ferdinand

Hi there, I have a similar problem. But I use R25 version.

If I write
exporterID[c4d.FBXEXPORT_SDS] = True or exporterID[c4d.FBXEXPORT_SDS] = False
I get error
AttributeError: parameter set failed

If I comment or remove this line, export works fine.

Maybe I should create a new topic with this issue.