- Home /
Stopping the 270 degree FBX default rotation on import
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.
Explaining:
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.
There's an option for this in the fbx export settings in Blender. It includes all kinds of axis rotations, just pick the one that you need!
Answer by pbcMark · Oct 10, 2011 at 04:49 AM
Thanks all.
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.)
Nah, it's definitely Unity that's wrong. Seriously, y up? z up is the only thing that makes sense.
Also, it does, it's just that new users need to have their posts checked by a moderator before they can be seen by the rest of the site- and sometimes that take hours. Sorry.
Graphics cards, web browsers, unity GUIText (and high school) think that Y is up. "Clearly" x/y are on the screen and Z is the 3rd dimension. The funny thing is, real 3D math thinks Z is up, which is why modelling programs use Z-up.
"Also, it does, it's just that new users need to have their posts checked by a moderator before they can be seen by the rest of the site- and sometimes that take hours. Sorry."
I was referring to the non-functional login system.
Thanks a lot for this workaround!
Edit: Actually I still have to model "up" as if Z in Blender was forward. I hope 3.5 fixes this problem.
Z forward makes sense from a 3D graphics program$$anonymous$$g perspective. In view space, y is the vertical span of your screen, x the horizontal, and z is the logical extension of depth. In all 3D applications including 3D modelling packages (where z is up), rendering to the screen includes the step of converting your scene into the view space coordinate system, where z is forward. So practically, z forward makes more sense than z up.
Answer by Benproductions1 · Nov 02, 2013 at 10:36 PM
Hello,
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:
http://wiki.unity3d.com/index.php/FixBlenderImportRotation
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,
Benproductions1
@Benproductions1: Thank you for the effort however, in Unity 4.3, my Blender models are co$$anonymous$$g in backwards and the objects Z rotation in Blender is not being changed to Y rotation in Unity.
If your models z
value is in the wrong direction you can simply change the rotation
in that script to rotate -90
degrees ins$$anonymous$$d of 90
.
Answer by mighty_marcos · Feb 28, 2014 at 06:18 PM
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.
Oh, well that worked - cheers! Although it seems suspiciously like witchcraft...
Answer by Owen-Reynolds · Oct 10, 2011 at 02:05 AM
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.
Answer by MonkeyZero · Jan 17, 2013 at 05:51 AM
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.
Your answer
Follow this Question
Related Questions
Blender import, messed up rotation, how do you fix it? 1 Answer
FBX import from blender rotation slightly off 2 Answers
Confusion with using textures for blender fbx models 0 Answers
Blender import to Unity has metallic shading, black spots when rigging is enabled 1 Answer
Blender Mesh Import issue 9 Answers