Where does the FBX importer apply the UnitScaleFactor?

I’ve been digging through the source for some time now, trying to fix a bug in the engine.

I’m seeing a bunch of weird behavior and I can’t work out what’s happening. Importing a FBX into the engine with a UnitScaleFactor of 100 does what you would expect - it scales the mesh down by 1/100th. However, nowhere in the source can I find a single uncommented reference to that value in FbxGlobalSettings - There’s one reference to “GetSystemUnit” that’s commented out:

// Convert the scene's units to what is used in this program, if needed.
// The base unit used in both FBX and Unreal is centimeters.  So unless the units 
// are already in centimeters (ie: scalefactor 1.0) then it needs to be converted
//if( FbxScene->GetGlobalSettings().GetSystemUnit().GetScaleFactor() != 1.0 )
//{
//	KFbxSystemUnit::cm.ConvertScene( FbxScene );
//}

This is obviously old code, since KFbxSystemUnit doesn’t even seem to exist anymore. However, I can’t find its replacement anywhere. There’s no references to the underlying variable either.

I’ve also pored over the FBX ASCII and I can’t find another value that the importer might be using instead - as far as I can tell the only place that scaling exists is in the GlobalSettings.

So, where is it? Anyone know?

One way it doesn’t appear to work is by transforming the vertices. Digging around in the physics mesh generation, it’s clear that no matter what size the mesh appears in the editor, all the vertices are completely the same as they were imported. So there’s a hidden scale transform somewhere.

To answer my own question:

UnitScaleFactor is ignored. Maya puts the scale into the local scale of top level groups, as well as skin clusters. (Skeletal mesh). NB: Maya 2015 is buggy and sometimes ignores the visible scale setting in the FBX exporter!

The engine does appear to apply the transform to the meshes, but then uses USkeletalMesh::RefBasesInvMatrix to transform the vertices back into their original positions when used for physics meshes.