Tag Archives: Blender

Unity And Blender Files

Importing Blender Into Unity

Since I’m using Blender and Unity for my current projects, I’ve had to figure out a common problem with this integration.

Right-handed… left-handed… up is forward… forward is up… dogs and cats living together.

There are a bunch of posts about importing models from Blender into Unity, and how they always come in rotated incorrectly. Blender is right-handed with (right, forward, up) orientation, while Unity is left-handed with the (right, up, forward) orientation. The primary axes seem to be forward and up, since the objects rotate around the axis that bisects those two.

Basically, you want your Blender model to face forward along the z-axis and up along the y-axis. This causes your model to appear to be pointing up in the Blender workspace, which is not really how you want to work on things. Blender has the ability to distinguish between applied rotation and displayed rotation, which I use to fix this apparent problem.

After researching and experimenting, I’ve decided to use the following method. However, I have not attempted to animate any of my objects yet, so that may not work properly. If animations, or any other feature, breaks this method in the future, I will update this post to reflect the fix.

Blender Workflow

  • In Blender, create your model upright using (right, forward, up) orientation.
  • Rotate the model (-90, 180, 0) using XYZ Euler rotation.
  • Apply the rotation.
  • Rotate the model (-90, 180, 0) using XYZ Euler rotation.

This will apply the corrective rotation, which fixes the rotation in Unity. Then it uses the second rotation to make the object appear correctly aligned in Blender. It just so happens that the complementary rotations are equal, since it’s effectively rotating the object 180 degrees around the (0,0.7071,0.7071) axis.

You could also rotate the model using (0, 0, 0.7071, 0.7071) in quaternions, or (0, 0.7071, 0.7071, 180) in axis-angle notation. It’s up to you. Generally these are safer, since they don’t suffer from potential gimble-lock, but this rotation works fine in Euler angles.

I’ve found that as I join objects together, they remain properly rotated. I haven’t tried anything too complicated though, like multiple objects or joining to a non-rotated object. I’ll test those situations out soon and update this post with any findings.

Facebooktwitterlinkedin