I’m trying to implement dynamic resizing on my humanoid character models at runtime. In order to do so I make use of the AvatarBuilder.BuildHumanAvatar API.
Modifying the skeleton’s T-Pose bone positions in the HumanDescription
I do manage to update the skeleton to its new size. Unfortunately on occasion I do seem to run into what seems to be a long-standing bug where upon animation some AABBs are invalid, as reported here.
However, for the models where this is not a problem, the sizing seems to work, except for some retargeting. To give you an idea, if I modify the legs to be longer, and then apply animation via an Animation Controller, the hip doesn’t seem to retarget appropriately, leaving me with a bendy-kneed avatar. I would expect Mecanim’s retargeting to kick in, appropriately adjusting the animation to the newly sized model.
For reference, if I try to make similar adjustments to the avatar in the editor by directly editing the skeleton’s T-Pose positions in edit mode, this works fine. (Note, this is in the Avatar Configuration mode when choosing the Configure your asset’s Rig). The animation does seem to get appropriately retargeted to the changed model when playing it afterwards.
My current thought is that I must be missing some API call or whatever trigger to appropriately have the retargeting happen. If any of you is aware of what must be done to have this taken into account I would love to know, because so far trawling through the documentation has not helped much, and the Google gods are not doing me any favours either.