Wrong object size after FBXLoader

I have imported fbx and it has the wrong size compared to glb (glb have right size).

This is a common issue with FBX and usually can be fixed by applying a scale factor of 1/100 or 1/1000. Sometime you’ll need to apply a rotation factor of -90 degrees on the x-axis too.

While working on the loader a few years ago I tried to fix this but could never get a satisfactory result. Fixing the transform for one model would just break another. There may be a way to fix it, something that I missed in the spec.

However, I recently spoke to a friend who works with Maya and Unity and she said these exact transform issues are common there too and they just deal with it by applying the inverse transform. So it might be an issue with the exporter not correctly applying axis or unit conversion, which is not something we can fix.

So, in short, just fix it at run time. It should always be factor of 10*n scale and 90 degree rotation.

Or use glTF :person_shrugging:

1 Like

Thanks for infromation. I’m working on an editor that automatically converts all objects to glb/gltf, before that I worked with this in unity and I had several libraries that get sizes more accurately. I’ll try to dig into their code, maybe I’ll find a solution.

1 Like

If you do, please let me know. Perhaps we can add a proper fix to the FBXLoader.

Forgot to mention - another tool I use a lot that has this issue is fbx2gltf - the glTF files you get out also commonly have these incorrect scale/rotation issues that also have to be fixed at run time. So I guess they haven’t been able to fix it either.

If you do look into it further, I would suggest looking into unit conversions for the scale issues (e.g. perhaps it’s incorrectly assuming cm/mm when it should be metres) and coordinate system conversion for rotation issues - for example, the 3ds max fbx exporter has a “convert to y-up” flag but it doesn’t seem to do anything.

Maybe i found a solution, i looked at how import works in blender fbx_import.py.
I found that there is a GlobalSettings in fbx, which has a UnitScaleFactor and keyAxis that are responsible for the scale and rotation of fbx. I started working on supporting this in FBXLoader. I already fixed it at home, but roughly. I’ll try to get it fully and clear implemented soon.