- Home /
Wrong rotation / position / scale when exporting FBX from Blender
This is a Q/A, if you already know the problem skip to the answer :)
Let's say you have made a model in Blender.
Something beautiful like this:
You have finished it and export it to *.fbx format. But the import in Unity actually looks like this:
The Scale is wrong. (It's 100. If the cube was 1 unit in Blender, you want it 1 unit in Unity!)
There is some weird rotation on the X Axis. (-90° why?)
Even if you remove the X rotation it's completly wrong in place and rotation.
When you have multiple meshes in one model they are at the wrong places too
Wouldn't it be nice to have the model just as you have created and can see it in Blender? Who cares for the Axis names, if you stack 2 boxes above each other in Blender you want them to be the same way in Unity right?
Answer by Piranha771 · Oct 18, 2016 at 07:18 PM
The solution
I made a model postprocessor for Unity's importer. It's inspired by the blender importer from the wiki page.
You can get the code for it here: https://gist.github.com/piranha771/e97c773fc050bc6387d36a080c4dd132
Just paste it in your editor project.
It does all the things to wipe away the conversion problems with Blender. This is the result:
As you can see there is no translation, rotation or scaling on the object. It just works right away even when you use drag & drop.
When using the Blender FBX export you can use the default settings with one exception: The Small button next to the scale has to be activated. Thats it.
Even mutiple sub meshes are translated correctly:
I didn't test animations yet, but they should work.
Just in case you missed it: To get 1:1 Scaling in Unity you have to activate the marked button: http://puu.sh/rNtbg/782be1b622.png
Could you elaborate on where "in your editor project" would be? I'm not sure where to put your script.
Edit: On a larf I tried putting the file in my scripts folder. It worked. You just put the script somewhere in your assets and it just works. I don't get it. ^.^;;
You shouldn't put the script "just in your Asset folder" as it would prevent you from building your game. As this is an editor script it can't be included in your actual game.
Editor scripts should be placed in a folder named "editor". See special folder names for more details.
This is perfect, I can't believe this question and solution is not more pro$$anonymous$$ent. I guess not many artists/devs out there using Blender -> Unity.