Search Unity

Problem with animating Hips in Mecanim

Discussion in 'Animation' started by DaveLHOz, Mar 12, 2015.

  1. DaveLHOz

    DaveLHOz

    Joined:
    Mar 11, 2015
    Posts:
    8
    I have a female character rigged and animated in Blender 2.73, and exported to Unity 5 via an .FBX. What is perhaps unusual for one of the animation clips I've created is that my character gyrates her hips like a hula dancer,and this is causing me endless headaches. For although everything animates fine in Blender, when the animations play in Unity, her body "breaks" at the waist, rather deforming to the hip movements; and I'm having a terrible time trying to troubleshoot the problem.

    In order to make the hip movements work properly, I did have to do a couple of things that are probably unorthodox, and I'm wondering if it's "confusing" Unity/Mecanim. First, in order to allow the hips to move
    independently of the upper body, I set up an IK chain with the spine, using the chest as the target. I also had to reverse the usual orientation of the hip bone so it could pivot at the point where it meets the spine.

    To make it look even more realistc, I also had to translate (not just rotate) the hip some to make the spine bend correctly. At first Unity didn't like this at all and gave me a "Bone translation not supported" error. But at least this much I was able to solve by "baking" the animaton in Blender prior to export. Now the animation works, but I've got this problem with the model breaking at the waist. It happens with walking and other types of movement, but is most pronounced with the "dance" anims. I've tried modifying skin weights and tweaking bone positions prior to export, but nothing has helped.

    I think bad mesh topology must be at least part of problem, and that some retoping might be in order; but
    before I expend any more time and energy on this issue, I wanted to get feedback from more experienced Unity users. I'm wondering if this type of "hula-like dancing" is actually impossibleto achieve satisfactorily because Unity/Mecanim just isn't expecting the hip/root bone to behave in that kind of way. But I thought I'd ask here to see if anyone had any ideas/feedback. I can also post screenshots if that would help...

    Thanks.
     
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    From my experience (not expert) I animate root node only for transformation/rotation of movement and orientation. For the subtle hip motions I key the pelvis bone, but I never translate the pelvis bone. You may follow this rule as well, but I thought I'd mention it first.

    I have another rule of thumb, and more experienced dev's may disagree with me about this, but I like to have a clean character pipeline so if I find an issue with an asset, especially a complicated asset such as a character, I always make edits/corrections in the animation package. That way there is no re-doing 'work around' fixes to the skin, rig or animations. I feel this is a better fundamental workflow so assets in the 3D package correspond as closely as possible with the final assets that are imported into Unity.

    From experience setting up an IK chain for the spine isn't bad. Unity only reads the rotational values (over simplification) of the bones so it doesn't matter if animated IK or FK.

    Does any parts of the upper body animate "with" the lower body or does it just look like skinning errors? Breaking at the waist could mean several different things - a render preview/video would be helpful to troubleshoot.

    The IK goal may be an issue. Instead of using the chest (is the chest a bone in the hierarchy?) as the goal maybe use a null object out in front of the character like an eye look at target. Parent the null IK goal to the hips and dampen it if you can so it doesn't inherit 100% of the hip movement, but some.
    Any type of dampening - lag controller or something similar may require baking, but since you are already doing that it's of no consequence at this point.

    I'd almost bet the problem is the quote above. I'm guessing you performed these edits in blender prior to exporting?
    Did you make these edits with the skinning information applied to the character mesh, or before skinning? Or after skinning but while the skin was inactive?

    Sorry - kinda spit balling here now. Can you clarify the quote for better understanding? There are a lot of things that could be causing the problem.

    If any edits were made in Unity I'd consider making them in the authoring tool rather than Unity. You want the cleanest pipeline/workflow you can have and making edits in Unity to fix issues that originate and should be fixed in the 3D package isn't a clean workflow. (personal opinion only)

    Please update if you've made progress or not and we can see if there is a solution.