Search Unity

[Blender] Bones in Gimbal Lock

Discussion in 'Asset Importing & Exporting' started by SoxwareInteractive, Jul 17, 2016.

  1. SoxwareInteractive

    SoxwareInteractive

    Joined:
    Jan 31, 2015
    Posts:
    541
    Hi,

    I have a character that I have rigged in Blender. When I import the .blend file directly into Unity, most of the transforms of the bones are in a Gimbal Lock.

    In Blender, the model is aligned with the Y-Axis being the up Axis (as in Unity), so that the model stands when the rotation is (0, 0, 0). The armature has a rotation of (0, 0, 0) and the selected bone "hips_L" has the transform as shown below:

    upload_2016-7-17_10-1-1.png

    Switching to Unity, the "hips_L" transform is in a Gimbal Lock:
    upload_2016-7-17_10-12-11.png

    Also most of the bones deeper in the hierarchy are in a Gimbal Lock. Could somebody please explain to me, whats going wrong here?

    Thanks in advance!
     
  2. Cygon4

    Cygon4

    Joined:
    Sep 17, 2012
    Posts:
    382
    Bones are based on quaternions, so the 90° Euler rotations shown in the inspector do not cause your bones to lose any degrees of freedom.

    Ending up with weird rotations in your bones is sadly a part of life with Unity.

    Despite the awkward orientations, the importer does get the keyframes right and all animation clips should play fine. Are you having any trouble with animations or are you rotating bones in script?
     
    theANMATOR2b likes this.
  3. SoxwareInteractive

    SoxwareInteractive

    Joined:
    Jan 31, 2015
    Posts:
    541
    Hi Cygon4, thanks for your answer!

    I wanted to animate the character in Unity using the animation window and Skele (see https://www.assetstore.unity3d.com/en/#!/content/16899).

    But even when using the quaternion interpolation mode in the animation window, the bones don't get interpolated in a straight line between my key frames (because of the Gimbal Lock). I already was in contact with the Unity QA team and they told me that real quaternion interpolation only works if an animation is imported from a 3rd party tool not when you create the animations with the animation window. --> that's why I tried to correct the rigging of my character to get rid of my bones being in a Gimbal Lock...

    Creating the animations directly in Unity has some cool benefits towards the tedious switching between Unity and Blender when fine tuning the animations...