Retargeting Animation Trajectories
Some animation engines track trajectory information for character animations, expressed
as the translation and rotation delta between successive frames of the animation.
This information allows the engine to blend multiple different animations regardless
of their starting positions. Blending the translation, rotation and scaling deltas
of the animations together at each frame ensures that the result of the blend will
end up at with appropriate translation, rotation and scaling relative to the previous
frame.
However, this trajectory blending can be problematic when you retarget an animation
to a character with different proportions—for example, when retargeting a walking
animation from a large character to a much smaller character:
- If the HIKForceActorSpaceId character property is activated in the target character’s HIKPropertySetState, the movements of the target character are constrained to the character space of
the source character. For example, a smaller target character will take extra-long
steps to match the original stride of the larger character. In this case, because
the character space of the original animation is maintained, the trajectory of the
original animation can also be used for the target character.
- If the HIKForceActorSpaceId character property is not activated in the target character’s HIKPropertySetState, the movements of the source character are adjusted by the HumanIK retargeting solver to suit the relative size and geometry of the target character.
For example, a smaller target character will take shorter steps than the source character,
reducing the length of its stride to suit its size. In this case, the trajectory of
the original animation will not reflect the actual movements carried out by the target
character—it will contain delta translations that are far too large. Blending this
trajectory information together with the trajectory information of other animations
will result in incorrect translations for the smaller target character.
To solve this problem, HumanIK can convert translation and rotation deltas you specify for your source character’s
animation into the character space of your target character. These adjusted delta
values provide your animation engine with the actual trajectory being followed by
the target character, allowing you to blend other animations on top of the retargeted
animation.
Setting up trajectory retargeting
The instructions below build upon the basic instructions for setting up and carrying
out a retargeting, presented under Using HumanIK.
- When you set up your target character’s HIKPropertySetState:
- At each frame, when you set up your source character’s HIKCharacterState, store the delta translation, rotation and scaling values since the previous frame
of the animation into the values maintained by the source character’s HipsTranslationId Node.
- At each frame, when you retrieve the results of the retargeting from your target character’s
HIKCharacterState, retrieve the adjusted delta translation and delta rotation from the target character’s
HipsTranslationId Node. Values are expressed in global space.
If the source character does not have a HipsTranslationId Node, the HipsTranslationId Node of the target character will contain values retargeted from the source character’s
HipsNodeId Node.