https://plugincafe.maxon.net/topic/11623/fbx-export-plugin-option-setting-with-python
Hi @Jiiny, first of all welcome in the plugincafe community.
As written in the documentation of GetWorldPluginData, GetWorldPluginData is not the way to go for importer/exporter.
Here an example for the FBX, if you want to see the full list of options please take a look at the C++ documention for Ffbxexport.h.
"""
Copyright: MAXON Computer GmbH
Description:
- Exports FBX with custom settings.
Class/method highlighted:
- c4d.plugins.FindPlugin()
- MSG_RETRIEVEPRIVATEDATA
- c4d.documents.SaveDocument()
Compatible:
- Win / Mac
- R16, R17, R18, R19, R20
"""
import c4d
def main():
# Retrieves a path to save the exported file
filePath = c4d.storage.LoadDialog(title="Save File for FBX Export", flags=c4d.FILESELECT_SAVE, force_suffix="abc")
if not filePath:
return
# Retrieves FBX exporter plugin, 1026370
fbxExportId = 1026370
plug = c4d.plugins.FindPlugin(fbxExportId, c4d.PLUGINTYPE_SCENESAVER)
if plug is None:
raise RuntimeError("Failed to retrieves the fbx exporter.")
data = dict()
# Sends MSG_RETRIEVEPRIVATEDATA to fbx export plugin
if not plug.Message(c4d.MSG_RETRIEVEPRIVATEDATA, data):
raise RuntimeError("Failed to retrieves private data.")
# BaseList2D object stored in "imexporter" key hold the settings
fbxExport = data.get("imexporter", None)
if fbxExport is None:
raise RuntimeError("Failed to retrieves BaseContainer private data.")
# Defines FBX export settings
fbxExport[c4d.FBXEXPORT_ASCII] = True
# Finally export the document
if not c4d.documents.SaveDocument(doc, filePath, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, fbxExportId):
raise RuntimeError("Failed to save the document.")
print "Document successfully exported to:", filePath
if __name__ == '__main__':
main()
Finally I would like to point you to few rules (I've setup your topic corectly but please do it for the next one).
If you have any questions, please let me know.
Cheers,
Maxime.