After reading this article I thought I understood how Mecanim works, but I encountered an animation problem with a generated character which I tried to fix by asking those who are knowledgeable about the subject, and what they have told me confused me again as to what Mecanim really is.
My original understanding was, Mecanim animations use ‘muscle space’, which is an abstraction from any rigging details. And a model’s avatar contains information needed to translate those muscle values to and from the model’s bone rotation values.
If it was the case, I thought I should be able to use an animation exported from a model in a different model provided that I have configured their respective avatars correctly, even if the source models have different poses from each other.
When I saw my character walking with legs apart with animation from Ethan model from the Standard Assets, I thought the avatar of my generated character, or that of the source model it was generated from was not configured using avatar setup tool in Unity.
But when I asked this to people who are knowledgeable about how the character generation framework I used, they said that its base model was already configured properly but I still need to use foot IK to make it work, since there is no real standard about model’s pose, and differences in a pose can result in such a problem, even if I use Mecanim.
So, I’d like to know if it is really the case that Mecanim doesn’t automatically deal with such differences in source model’s pose even when I set up my avatar in Unity, and if so what additional steps I need to take it work properly across different models/animations.
That’s right. There is the additional step of making sure that the base pose for all of the avatars (your character and the animations) match. Being able to modify the base pose of your character offers some additional flexibility at the expense of a bit of extra work.
Just a technical note, the humanoid system that you’re talking about is separate to mecanim.
@TantzyGames Thanks! With both of your answers, it seems likely that my understanding of Mecanim was mistaken.
Just to be perfectly clear, please let me confirm that I understood your answers correctly.
Import an animation from a source model (i.e. from a FBX file).
Create and configure an avatar for that model, using *Unity’*s avatar setup tool.
Create and configure an avatar for the target model.
From what I’ve been told in this thread, it seems that the above mentioned process is not sufficient to ensure that an animation to work properly across models. So, I also need to make sure that both of the models use the same posebefore they were imported into Unity. (Unless I want to use IK to workaround the differences.)
Am I understanding it correctly now? And if so, it makes me wonder how I can be sure animations that I can purchase from Asset Store use a compatible pose? Is using a T-pose in source material a mandatory convention when I make animations to be used in Unity?
No. When you configure the avatar you can adjust it’s pose in the Scene View.
Unity is really good at auto-configuring avatars so I find I rarely need to change them (although the recent addition of the 3rd spine bone complicates things a bit). So I just go in there, double check all the joints are assigned properly, and then adjust the pose to match my target avatar (or you can adjust the pose of your target avatar if you have a lot of animations from the same source).
Ok, thanks for the clarification. That was my original understanding of how Mecanim works which I tried to explain in my question.
I thought configuring avatar in Unity should be sufficient to deal with potential differences in source model poses, but I was told that I also need to make sure that those poses match outside Unity in source material. So I wanted to make sure which is really the case.
I imagine that’s why Unity allows for adjustment of the avatar pose, because everyone’s idea of a T-Pose is slightly different. Being able to adjust it from within Unity makes it much easier to re-use and share content.
If you consider that part of configuring the avatar is the pose adjustment then you’re absolutely right!
Agree with Tantzy - this step is do-able in Unity by enforcing the T-pose in Unity under configure, and having the ability to adjust the avatar pose.
The best modeling pose is A-pose for shoulders and arm pits so having ability to enforce T-pose in Unity is great. I don’t With the ability to enforce T-pose and adjust the avatar pose in Unity we can assure the animations work as they are supposed to on most(all) models within reason.
kubold has a video on youtube showing how to adjust the avatar pose so his mocap animations work on multiple sized models.
Thanks for the reply. It seems that my initial understanding was right after all. In that case, I guess I need to talk to the people whom I asked the question again.