I am trying to make an exporter that saves out a scene hierarchy and exports the meshes in a scene as separate collada files. Yes, I know: Collada is crap - but the engine only takes this format I am afraid.
I’ve worked with FBX exporters before so I know the drill for exporting out objects.
But when it comes to the Collada format I am confused. I’ve tried both the file -command (with the type flag set to “DAE_FBX export”) and I’ve also tried the FBXExport -command and neither seem to spit out any DAE files for me.
Using pymel.core.FBX* (pymel.core.other.FBX*** in PyMEL 1.7 and earlier)**
pm.mel.FBXResetExport()
# Then I run a couple of commands to setup the settings for the FBX plugin, like:
pm.mel.FBXExportFileVersion(v="FBX201600")
pm.mel.FBXExportColladaTriangulate(True)
pm.mel.FBXExport(
s=True, # selection
f=export_path, # fullPath - directory, file name and type specified, ex c:\dolan\duk.dae
caller="FBXDAEMayaTranslator" # Makes the damn dialog appear
)
No files output. Batch export gets stuck because the dialog appears and Maya then complains about “the dialog is already open”. But even if I export a single primitive, no file is generated. The only collada-related FBX -commands I find are:
FBXExportColladaFrameRate
FBXExportColladaSingleMatrix
FBXExportColladaTriangulate
Using pymel.core.cmds.file
options_string = "model=1;animation=0;material=0;optimisegeometry=1;normals=1;tangents=1;colorformat=2;colorsets=;uvsets=$map1$;"
pm.cmds.file(
force=True,
options=options_string,
type="DAE_FBX export",
preserveReferences=True,
exportSelected=True,
)
Does not work nor does it generate any errors. The only thing that happens is that some warning pops up in the “Warnings and Errors” -dialog:
“Warning: ‘Null’ type not supported by COLLADA. Only the transform data of node: ‘cylinder_grp’ will be saved.”
Not sure how to progress here as the FBX documentation is utter crap…
CLUE:
The wrong dialog appears. It’s not the options dialog for the Collada format that appears but the usual FBX options dialog. This happens both with the pymel.core.FBXExport() -case and the pymel.core.cmds.file() -case.