Home Technical Talk
The BRAWL² Tournament Challenge has been announced!

It starts May 12, and ends Sept 12. Let's see what you got!

https://polycount.com/discussion/237047/the-brawl²-tournament

FBX export maya Mel problem

polycounter
Offline / Send Message
sprunghunt polycounter
I'm trying to create a one-click export for FBX using the scripting commands listed here:
 
 
 
I have this block of MEL : 
 
  1. <div>//units settings&nbsp;</div><div> FBXExportScaleFactor 1.0 ;&nbsp;</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>&nbsp; &nbsp; &nbsp; &nbsp; FBXPushSettings;</div>


which is followed by: 
 
  1. 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
  1. <div>print ("file units " + ` currentUnit -q -linear` + "\r\n");</div><div> print ("scaleFactor " + `FBXExportScaleFactor -q` + "\r\n");</div><div> print ("convertUnit " + `FBXExportConvertUnitString &nbsp;-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

Sign In or Register to comment.