Humanoid avatar auto-generation from script

Hi,

When you have a model, you can manually set its animation type to ‘Generic’, ‘Humanoid’, ‘Legacy’ etc.

When I select Humanoid and apply it, Unity successfully generates an avatar for my Humanoid character, and it’s fine, but when I set my model’s Animation type to Humanoid from script (using modelImporter.animationType), Unity does not generate/configure the avatar properly, and I get this:

3150795--239478--AvatarNotConfigured.jpg

I saw that I can create an avatar from script with things like the AvatarBuilder and HumanDesription classes, but it seems that I would have to recreate the whole thing myself, while I just would like Unity to create/configure the Humanoid avatar the same way it does when I set the Animation type manually.

Did I miss something?

I have the same problem. Is there any solution for this?

You want to get at the “Enforce T-Pose” command from the avatar configuration. Sadly, that’s not available from scripts.

You can either bite the bullet, and write out a script that sets all of the transform positions and rotations correctly in the import (assuming all your models have the same values), or just live with having to set the models as Humanoid by hand.

Uhnn…
So, you mean there is no method to change the animation to Humanoid via script.
A will report this (bug) to Unity to solve the problem.

A feature not existing is not a bug.

The only thing that’s required from Unity’s side is to expose the “Enfore T-Pose” command to user scripts so it can be run during model import. Maybe @Mecanim-Dev or someone else could be convinced to do that.

Made a Feedback entry for this. Not that I have much faith in Feedback, but oh well. Vote for it if you want to.