I'm trying to create a one-click export for FBX using the scripting commands listed here:
I have this block of MEL :
<div>//units settings </div><div> FBXExportScaleFactor 1.0 ; </div><div> FBXProperty Export|AdvOptGrp|UnitsGrp|DynamicScaleConversion -v false;</div><div> FBXProperty Export|AdvOptGrp|UnitsGrp|UnitsSelector -v "Meters";</div><div> currentUnit -linear "m";</div><div> FBXPushSettings;</div>
which is followed by:
FBXExport -f $exportName -s ;
"$exportName" is the output path I want.
It runs fine. However the scale of the exported file is not correct.
If you export a FBX manually and set the scale (under advanced settings> Units) incorrectly and then use the exporter script it will use the scale set in the previous export. If I run the script twice - the second export will be the correct scale.
Also if I open Maya and immediately use the export script it will spit out this error:
// Error: Syntax Error: bad value for this property. Use a valid enum item. //
This seems to be caused by the FBX plugin not being properly initialized when you start Maya. The value it's complaining about is "Meters".
Also I put in debug print commands that execute after the export
<div>print ("file units " + ` currentUnit -q -linear` + "\r\n");</div><div> print ("scaleFactor " + `FBXExportScaleFactor -q` + "\r\n");</div><div> print ("convertUnit " + `FBXExportConvertUnitString -q` + "\r\n");</div><div> print ("unitsSelector " + `FBXProperty Export|AdvOptGrp|UnitsGrp|UnitsSelector -q` + "\r\n");</div>
These show the scale values as being set correctly by the code even though the exported file is not the right scale
Replies
http://help.autodesk.com/cloudhelp/2016/CHS/Maya-Tech-Docs/Commands/file.html#flagexportSelected
That will pick up your current fbx export settings and use them so as long as they're good you'll get the results you want.