Hello @kenc ,
sorry you are having such problems with the FBX exporter maxscript setting.
I'll try to explain the FBX setting hoping it can help you find the issue you are facing.
The Automatic Unit conversion is set (automatically) to 'false' when setting conversion units to different type than the Max scene.
this can be verified when looking in the FBX files exported as ASCII
FBXExporterSetParam "ASCII" true
In the FBX file, look for the "GlobalSettings:" near the top of the file.
There are 2 properties related to the Units
"OriginalUnitScaleFactor" is the Max scene Units
"UnitScaleFactor" is the Exported Units from the Automatic Conversion.
Keep in mind that FBX (MotionBuilder scene file type) is in Centimeters, meaning that 1.0 in FBX is a centimeter.
So if Max is set, for instance in Inches and the Automatic Units is set Automatic (to Inches) then the global settings would read
P: "UnitScaleFactor", "double", "Number", "",2.54
P: "OriginalUnitScaleFactor", "double", "Number", "",2.54
"OriginalUnitScaleFactor", "double", "Number", "",2.54 mean Max is set in Inches, as 2.54 cm per inch
"UnitScaleFactor", "double", "Number", "", 2.54 mean that the Conversion Unit is set to Inches.
If Max scene is set to Meters and exported as Centimeters, it would read:
P: "UnitScaleFactor", "double", "Number", "", 1
P: "OriginalUnitScaleFactor", "double", "Number", "", 100
When a conversion is applied (Automatic Conversion is False), a scale is applied to the node also, not the mesh data but the node. This can be found in FBX file in the node's properties, as local scale:
P: "Lcl Scaling", "Lcl Scaling", "", "A",100.00000066,100.00000066,100.00000066
Some confusion with the Unit Conversion "Scale Factor" in the UI and the FBX command "ScaleFactor":
FBXExporterGetParam "ScaleFactor"
FBXExporterSetParam "ScaleFactor" 100.0
In the FBX Exporter UI > Units > "Scale Factor" is a display information about the unit conversion from Max to FBX using one of the valid units: "mm" "cm" "dm" "m" "km" "in" "ft" "yr" "mi" set by the FBX commands
FBXExporterGetParam "ConvertUnit
FBXExporterSetParam "ConvertUnit" "cm"
This setting will affect the FBX GlobalSettings: "UnitScaleFactor" mentioned above.
The maxscript commands "ScaleFactor" is an additive scaling applied to the Node's local scale
So, setting a "ScaleFactor" in maxscript will apply a Scale on the node: its "Lcl Scaling".
When importing in Unreal, there are options about the Scale import in the FBX import settings. It may be set to import scale as 1.0 and may explain why the "ScaleFactor" you apply may not import as expected.
Other useful commands.
the FBX UI for the export settings can be opened this way for viewing/setting in the UI, this opens Settings and wil not Export.
OpenFbxSetting()
A maxscript access to the FBX settings UI options
-- get FBX UI properties
FBXExporterGetParam "FBXProperties"
-- can get and set UI properties for Dynamic Scale Conversion, the Automatic Conversion
FBXExporterGetParam "Export|AdvOptGrp|UnitsGrp|DynamicScaleConversion"
FBXExporterSetParam "Export|AdvOptGrp|UnitsGrp|DynamicScaleConversion" false
I hope this can help clarify.