I am working on a character editing system that scales a character model’s height and weight by scaling the bones and updating the bind pose.
But after I’ve scaled the bones and call armature.saveBindPose(); the weapon in my character’s hand attachmentNode is not in the correct location.
Here’s a screenshot showing the character model after having it’s upper spine bone scaled up drastically, but the things attached to attachment nodes (the red sword, the sheild, and the translucent hitbox debug shapes) are still in their original position:
Is there something else I should be doing after calling armature.saveBindPose(); to get the attachmentNodes to update as well, or is this potentially a bug in the new animation system?
Curious, are you using uniform scaling on all axes or changing only like x or y or something?
I’m not sure it could be related to your issue but note that non-uniform scaling it not really supported the way one would like. (ie: not in a scene-graphy way)
I was going to scale y for height, and scale x/z for adjusting the weight. But I’m still expirementing with things to figure out exactly how the model behaves when changing a joint’s scale and translation like this.
I think it may be better to adjust the joint’s localTranslation for height, and do uniform scaling for the weight.
But in both cases the attachment node issue still happens.
It turns out that scaling any bone (even uniform scaling) has very bad effects on the child bones far down the bone hierarchy.
I notice that the arm and especially the hand bones get really messed up if I scale the spine bone by any significant amount to make a character look fatter or skinnier, since the hand bones are children to the base spine bone I scaled.
So I think it is actually best to only adjust the localTranslation of a bone to change a character’s height (I’ll probably just slightly translate the leg and torso bones to increase height), and then to adjust a character’s weight I will just scale the whole spatial.