Why isn't Segment Scale Compensate supported?

Or is it?

This is such a common feature, and is on by defualt in Maya 2012. A simple test export of a two-joint, skinned-mesh results in errors in Unity…

“ImportFBX Warnings:
File contains 1 (out of 5) nodes with Scale Compensation. Scale Compensation is not supported by Unity (because it works differently in 3dsMax and Maya)…”

The solution is to turn off a commonly used feature that’s on by default in Maya? This feature is so basic, I’m hoping someone has a solution that doesn’t involve changing standard rigging/animation workflows.


Are your characters doing weird scale things in Unity coming from Maya? It’s probably the Segment Scale Compensate on joints causing your problems. This MEL script will fix you up, selecting all joints and turning SSC off for all joints.

string $selected[] = `ls -type joint`;
select -r $selected;
string $sel[] = `ls -sl`;
string $singleJnt;
for ($singleJnt in $sel)
setAttr ($singleJnt + ".segmentScaleCompensate") 0;

I guess it makes animation update and blending more complicated, and in many cases it isn’t really required.
I experimented a bit with a script that implements segment scale compensate on a bone behaviour, but in the end decided against supporting it.
The optimal solution would be if Maya/Max had an FBX export option to automatically bake ssc into animation curves during export, though that depends on Autodesk to do it.

My solutions:

  • if you don’t need ssc for your animation disable it, for example using the script or attribute spreadheet options discussed above
  • you can achieve the same effect manually, for example if you have a cartoony character with squishy limbs. That’s a extra work though.
  • you could create a separate “animation” rig to the “game” rig. Your game rig has segment scale compensate switched off and only the minimum number of bones required for your skinning and game features. A separate animation rig has segment scale compensate enabled, and any other features you may want. Your game rig is then constrained to the animation rig, and during export you use the “sample animation” flag. This worked in my tests, though I’m not sure if Unity is smart enough to discard the unused animation curves from the animation rig.

Presumably this is because Autodesk’s own FBX format does not support this feature. This is a pretty serious limitation for us. Let me know if you find a work around. I’ll do the same.

While searching for a solution to this error brought me to this topic… so I’ll post my findings here. :slight_smile:

As part of the Unity error console output, you’ll see a list of offending joints. In Maya, select each of these, then:

  1. Hit ctrl+A (opens the Attribute Editor).
  2. In the ‘Joint’ section. Just below the Joint orient axes boxes, un-check the Segment Scale Compensate.
  3. Re-export.

And, if you have a lot of them, here’s a quick script to turn off this feature on ALL selected joints:

//Fix Scale Compensate
 string $objz[] = `ls -sl`;
 for ($thisObj in $objz){
    setAttr ($thisObj+".segmentScaleCompensate") 0;

(paste this into your script editor, select the text and middle mouse drag the selected text up to your shelf to create a button)

It’s not supported because Maya and Max handle it differently.

You can get a decent result by breaking out the parts of the joint chain from the normal hierarchy (with compensation turned off) and slaving them to a normal skeleton with compensation. Link the along-axis translation of the last joint in the chain to the scale ratio.

In Maya, use the Attribute Spreadsheet (not the Attribute Editor) to turn off Segment Scale Compensation on a large number of joints simultaneously. The column can be found just over half way through the All tab.