How to use humanoid animations with the Animation component

I have converted imported animations and character models to be “humanoid”, which brilliantly makes all these assets compatible with each other (at least when used with the new “Animator” component). Is there a way to convert the animations and models back to the Generic animation system (i.e. so they’re usable by the old “Animation” component) while keeping their compatibility with each other? Do I need third party tools to do this or can Unity do it?

Background:

The old Animation component’s API is perfect for my application (Play, Stop, Rewind, AddClip, CrossFade, etc.), as I have a very large number of character animations which I need to randomly switch between quickly, and jump to particular states.

The Mechanim system is terrific because I can make my assets compatible with each other by making them all “Humanoid”. The animations and characters then all become compatible, which isn’t the case with Generic or Legacy animation types, where models can use only those animations built specifically for them.

My problem is that the old “Animation” component doesn’t seem to understand Humanoids, nor let you set an Avatar (which I guess is a requirement for using Humanoid animations).

I have tried using the new Animator API, but it simply is created for a different purpose. It does not support jumping a random state, nor even resetting to the original state (e.g. see Restart Mecanim's Animator controller - Unity Answers ) and lacks the ability for a state machine to be created programmatically. The old animation component is simply a far better fit for my application.

Is there a way a better way to make these animations all compatible? Are there plans to make the Animator/Mechanim API more complete and flexible for programmers? Have I overlooked some component or class which allows lower level access to the Mechanim system?

As you stated, you can only go back to Legacy if the bones defined in the animation exactly match the bones in your model. You could trying renaming either one – for example, rename the bones in your model’s skeleton to match the animation. I had to do this once when an artist exported a model with the wrong bone names. It worked, but in my case the structure and scale was correct, it was just the bone names that were wrong.

There are some commercial third-party tools that can retarget, or you could use Mixamo’s service or something similar.

Mecanim in Unity 4.3 (currently in beta) will add a Animator.GoToState() function, which will make the need to use the old Animation component unnecessary.

edit: It’s been renamed to simply Animator.Play() in the final 4.3 release.