I want to know if it is possible to prevent automatic rotation of FBX objects during importation to Unity, and how to do it if possible.
When importing an FBX format object from Blender 2.59, I notice that a 270 degree rotation is automatically applied on the x-axis. This is apparently performed in order to compensate for the z-axis-up characteristic of Blender, which conflicts with the y-axis-up characteristic of Unity.
The Unity documentation advises the user to correct the rotation of objects to a y-axis-up orientation in their modeling software. I have done this, rotating objects so that the y-axis is now up and then “baking” this into the objects by using Blender’s “Apply > Rotation” command.
However, upon import to Unity, the 270 degree rotation along the x-axis is still applied, though it is unwanted. (I understand why - how would Unity know which way I want the model to point?)
I have read posts which seem to be saying that using the 270 degree rotation from Unity will cause problems with scripting and animations. If this is true (and the documentation suggests it might be), then is there a way to stop Unity from rotating FBX objects 270 degrees? If I’ve already applied the rotation fix for y-up in Blender, I don’t need it applied again in Unity.
Looking at the import settings, I see rotation error values for animations, but nothing addressing the automatic 270 degree rotation.
I have found that applying a +90 rotation on the x-axis in object mode in Blender, followed by use of the Apply > Rotation command, orients my models correctly for export. Then, I have found that selecting the “Selected Objects” checkbox under Export FBX in the export screen and setting Y to forward and Z to up (that’s positive Y and positive Z) works. I get the model in Unity with the correct side facing up, no rotations applied in the inspector, and axes aligned in the proper directions.
One thing to be careful of is the notation -Y forward (Blender) which is WRONG (at least for exporting to Unity). It must be set to positive Y forward, NOT negative Y forward.
(BTW, this Qato thing doesn’t work.)
If you want Unity to correct for the difference in axis’s you can write a
AssetPostprocessor that does it for you. Thankfully I’ve already written one and released it on the wiki:
This means you can just import your blender models as normal, without having to do any modifications in either blender or Unity.
Hope this helps,
I’ve discovered a great workaround for 3dsmax. Simply add a dummy to your scene, the object will still import with a 270 degree rotation, but when instanced, there will be NO -90 rotation applied to it.
A dummy comes in as a transform, with tiny overhead. It could be another mesh for that matter, but a dummy will do.
And no parenting involved, just select your mesh, your dummy and export selected.
Hope this helps everyone.
FBX export doesn’t rotate the model – if the model faces +z with +y up, it will look fine in Unity – but there are some things to watch for:
If you rotate in ObjectMode in Blender (the one where you can select different objects,) then you are really changing the Blender Transform, but not changing the “real” model. It’s very easy to do this by mistake. To check, select Object->TransformProperties. Should see all 1’s for scale and 0’s for rotation.
To really rotate the model, go to EditMode, select all verts, and rotate them.
The export rotation settings in Max aren’t helpful for us – they change the transform after export. But, the ones in Blender really do work – they change the verts (well, in 2.49 they do.) Blender FBX-export comes with RotX90 checked (which sort-of flips modeller z-up to Unity y-up.) Be sure to uncheck that if you model everything Unity-oriented.
Huh, I’ve been Banging my head on the Keyboard for weeks now trying to get blender to export the meshes the correct way.
I figured out, rather quickly on my own, how to set up blender’s building environment so that the object are built to unity scale at a 1:1 ratio in the metric measurements.
Honestly either Unity should Give the user control as to how to handle the X,Y,Z Orientation issues or blender needs a script that handles this.
Now, It’s was a week or so ago when I last gave this issue a go, but I think I tried this and it seems to get a sort of strange issue where the model was 0,0,0 Rotation but the side the rifle i was building breach was on was on the opposing side. Totally the wrong direction, and not even scaling -1 in blender fixed this issue.
@Owen Reynolds: You can rotate in object mode then hit CTRL+A to apply the “Rotation and Location” back down to Zero. this is in face actually committing the Orientation of the model
Anyways, Maybe I did do this wrong and so I’ll give it one more go and see if this works out. thanks you very much in advance.
For Blender: You can just add an empty to your scene and everything works fine.