Blender Armature to Unity Rotation Issues

I’ve created a character in Blender and rigged and skinned it. Now I’m trying to bring the rigged character into Unity, but I’m having issues with the rotations of the bones in the armature. Rather than all the bones rotations be at 0 as they are in Blender, they are strange angles. A couple of them retain their 0 rotation, but the others all non-zero rotation values on at least 1 axis.

This is a crippling issue as I am trying to create a “puppet” system of active rigidbodies. I am attempting to use joint target rotation on my ‘ragdoll’ to mimic the rotation of an animated character. The non-zero rotation seems to be a big deal here as all the joints with non-zero rotations seem to follow the rotations of the animated character on the wrong axis, which I’m not entirely sure why (for example I bend the puppeteer at the knee and the puppet bends the knee 90 degrees out the side rather than back)

I’ve been combing for hours to find a solution and haven’t found anything good. I’ve found several threads of people asking similar questions, but no real answer. I’ve tried the approach of adding an empty gameobject parent to each bone with zeroed rotation, but that seems very messy and I’m having a lot of issues getting that to work well.

Is there any hope of being able to bring Blender armatures properly into Unity in the future? I’m about ready to give up. It seems like something that could be solved on either the Blender or Unity end so I’m really surprised there doesn’t seem to be any solution. Appreciate any thoughts on the subject.

Blender uses a different coordinate system than the FBX standard, evidently, so it does some quick-fix last-minute rotations to try and orient the model properly. This creates a minor irritation for Unity users because the object comes in with a weird rotation at it’s root. Most people just hide their Blender model under a parent object and move on.

Someone uploaded a custom FBX exporter script for Blender which fixes some of the rotation weirdness:

So far, I’ve not been annoyed by this problem enough to try-out this script, so I’m not exactly sure what all it does.

I don’t believe that having the rotation of every bone initially set to 0,0,0 is a requirement for most people, so there may not be a ready-made solution for that. If the code above doesn’t already do what you want, it may serve as a useful starting point.

1 Like

Even the skeleton in T-pose cannot have rotations zeroed out for every bone. Places where the arms connect to the body, etc. You only see zero rotations in Blender Pose mode because they are calculated as offsets from the rest pose, and not true global/local

I post/necro this thread as I found myself here for a similar question as it was Google’s most prominent result.

@DimitriX89 , is partially correct, child bones with rotations that differ from their parents can’t really be ‘zeroed out’ as they do technically have a different rotation. But, it is possible to have ‘zeroed out’, rotations on armature bones that all point the same direction, or to have bones maintain their relative axis alignment.

Axis Alignment: (

)

  • Select your armature, go into edit mode, then select each bone and make sure that their Roll parameters all match, and are appropriate for your desired transform alignment.
    On the Data Object Properties of the selected bone, you can expand Viewport Display and select Axes to visualize their axis roll alignment.

‘Zeroed out’ Rotations
As mentioned, this is only doable if the bones point the same direction, and have the same alignment. EG: A length of chain/rope, or joint.

  • Rig your model, and assign weights/vert groups, etc. to your bones.

  • Select the mesh, then Shift select the armature.

  • Right click and choose Parent > Clear and Keep Transform.

  • Keeping your selection, Rotate the mesh -90° on the X axis.

  • Select Object > Apply > Rotation.

  • Rotate the mesh +90° on the X axis. (Do NOT apply this second rotation!)

  • Right click and choose Parent > Armature Deform.

  • Select all objects you wish to export and select File > Export > FBX

  • Configure your export settings as follows: (

    )

  • Transform > Apply Scalings: FBX Units Scale

  • Transform > Forward: -Z Forward

  • Transform > Up: Y Up

  • Transform > Apply Unit

  • Transform > Use Space Transform

  • Armature > Primary Bone Axis: -Y Axis__*__

  • Armature > Secondary Bone Axis: X Axis__*__

__*__The model in my example was built vertically (Z Forward), yours may be horizontal (-Y Forward), If the Primary and Secondary Bone axes don’t do it for you, change their values until you get the desired result. for your model. -Y as Forward: [Z Axis, -X Axis]; Z as Forward: [-Y Axis, X Axis]

Hopefully this helps anyone who arrives here by google, It took me a while to figure this out from various sources, but addressed an issue with bone rotation limits and bones importing from blender in a gimbal locked state.

5 Likes