- Home /
Create a pose for a mecanim avatar at runtime c#
I'm trying to pose an avatar at run time based on motion capture data live streaming from another piece of software. Incoming I have an xml with a list of bones an their transforms and positions. I have created a system which applies this to the transforms of bones directly however this creates distortions as the size and limits of the model are not respected by directly editing the transforms.
Is there any way to pose the avatar (possibly by generating an animation) so that a pose can be translated onto any rig successfully, the same way human animations are translated across?
I've looked into the AvatarBuilder class, but I don't think I need to create a new avatar, the model has one, I just need to access its bones.
Answer by Mindmapfreak · Jun 28, 2016 at 12:10 PM
You could use the HumanPoseHandler-class for this. What I wanted to do was similar to your task. My animation-data was livestreamed on a character and I wanted to save it as a humanoid animation. You probably need a character with correct proportions to use the class (directly) though. See my question regarding this topic for more details. You could also take a look at the code of the Qualisys Unity SDK (which I used to get the data on a character in the first place). Feel free to ask if anything is not clear.