Search Unity

retargeting mecanim anims to my character creates unnatural poses

Discussion in 'Animation' started by halley, Oct 27, 2013.

  1. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    825
    So, I've been working on a new character from scratch. She's an Edo-period Japanese peasant girl, wearing a scruffy kimono. She's the simplest character of a set of characters I wanted to develop, because she has no particular "feminine" posture. She stands simply, with a standard Blender Rigify meta-rig.

    I made a few animations that would be specific to my project, relying on the fact that there's a vast number of Humanoid Mecanim animations out there to round out the project for the basic stuff like walking and running.





    After the transition, the figure has been pulled to a new pose. Obviously there should be a little difference, as the mocap actor held his hands in a different way than I posed my figure, and so on. But essentially, they are both standing at ease directly over their feet, so I would expect the same. Instead, the thighs have been pulled forward so she's off-balance. You can't really see it in a single shot, but she gets a bit thinner too. I'm guessing it's spine curvature, though she doesn't get taller with the flattening of the spine.



    I guess I'm wondering what differences in my Blender rig (a plain Rigify meta-rig with no IK bones) and the mocap skeletal data (which we can't see). The upper torso seems fine, so it must be a difference in where the two rigs think that the femur connects to the pelvis.

    I thought it might be a difference in my rig's muscle definition, so I reset all of it to defaults, and tried again from the beginning: same problem exists. It really does seem like the issue is between the skeletons.

    I also thought that I might be able to adjust the mocap animation to fit my avatar. So I changed from



    to



    but then all that I see in the animation is my character goes to the fetal (no-muscle) position for the whole strip:



    The Console explains the error pretty simply:



    I really am confused at this message though: I thought the whole point to Mecanim was to avoid having bone-naming conflicts. That's why you identify what is the "hips" and what is the "second knuckle of the index finger" using a cute little GUI. Every animation can refer to its original skeleton, then map it to the new skeleton. It seems to work in some places but not others. If not, I will have to go back into my character and remap... and hope that some other animation on the store doesn't use the word "Pelvis" instead of "Hips."

    If Mecanim really is not able to compare two skeletons for their relative joint positions, bone lengths, and so on, then it's really not as re-targetable as it claims to be. This character is a plain humanoid standing in a very similar visual posture to the original mocap, and yet I can't just use the hundreds of animations on the Unity Asset Store or the Mixamo Animation Store. I'll have to do all the animations from scratch (either the specialized ones I've already done, or the general ones I hoped to use).

    My next character was going to be an old woman who is hunched over a bit. This problem would only get worse. I'm really hoping there's something I can adjust now.
     
  2. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    825
    So nobody else is having this kind of trouble with retargeting animations from other models? I've followed all the documentation and demos, and it works fine for the Mixamo characters. I just need to know what's different/wrong with my model that causes the poor thigh angles, because it's so obviously noticeable.

    Until then, I'll just animate my own basic idle, walk, turn, step up, step down, rah rah rah... but it seems like quite the waste of time. This also makes it that much harder to design and sell characters, if Mecanim can't really explain what is retargetable and what won't work.
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,704
    I've run into similar problems when the legs got auto-mapped wrong (i.e., model's left leg bones assigned to avatar's right leg). Are you sure the legs are mapped correctly? It kind of looks like the same issue. If you imagine the knees switched around, she would have the normal slight bend in her knees that looks natural.

    You could also, as an experiment, try filtering the model through Mixamo's auto-rigger and see if the resulting rig works any better.

    If you're using twist links, you could try the steps in this post: http://answers.unity3d.com/questions/406073/im-having-trouble-getting-my-animations-in-unity-t.html
     
  4. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,740
    Humanoid retargeting is based on the concept that you import the animation on whatever skeleton+avatar it was created for. And then you play that animation on a different skeleton+avatar and it will look right.

    If it doesn't look right its because their T-Pose isn't configured correctly. What is important here is not to align the skeleton, but to align the meshes. So the body proportions should be in T-Pose, not the actual bones!

    So when importing an animation always use the avatar that matches the animation, which rarely is the destination avatar.

    I hope this helps
     
  5. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    825
    I'll definitely double-check every bone; a left/right swap would have been hard to notice. To be sure I get you, you weren't talking about axis differences but whole bone assignments, right? Right side of hips assigned to left femur, etc.?

    I'll give that a shot. My impression when I looked through the Mixamo rigging that it was basically a way to make my model compatible with Mixamo actions but with the downside it would be hard for me to add my own actions later. Maybe I missed something.

    If you mean "twist links" like a two-bone femur, or a bone in the knee, no. It's all plain-jane rigging from Blender's Rigify. Rigify has a simple FK/deform rig that they call the meta-rig, then a complicated IK rig that wraps around it. I'm just using the meta-rig.
     
    Last edited: Oct 29, 2013
  6. MikeErty

    MikeErty

    Joined:
    Feb 24, 2013
    Posts:
    19
    Did you get this sorted in the end? I'm getting similar issues now and can't find any info about it other than threads like this...
     
  7. fleshtheworld

    fleshtheworld

    Joined:
    May 26, 2011
    Posts:
    126
    I also have the same problem with re-targeting my skeletons/rigs to mecanim's humaniod. Every bone is pretty much ever so slightly offsetted to where it is obviously offsetted. I think there are options to adjust the offset, etc. since I recall working on it but I forgot how well it went. I cant find much info on Mecanim. Right now I assume its only for mocap and people who buy animations. It doesn't feel animator friendly at all. Im an animator, you can say, more than a programmer at least, and legacy is much easier to use and work with than mecanim.
     
    Last edited: Jan 15, 2014
unityunity