Runtime Retargeting
Overview
Runtime Retargeting feature supports sharing animations between consistent naming skeletons with the same number of bones and hierarchy. In addition, animations can also be shared between skeletons with inconsistent number of bones but the hierarchy is compatible with animations.
Runtime Retargeting can be used at runtime to determine whether a bone's data source comes from animation or bone, and whether special processing is required, for example, a certain proportion of translation and scaling.
Reusing Animation Assets
The following three Actors with the same number of bones, skeleton hierarchy, and naming but different skeleton sizes can share animations with each of them by using the Runtime Retargeting feature. For example, the Short Bulky Actor and Tall Slim Actor can reuse animations of the Source Actor.
![]() Source Actor | ![]() Short Bullky Actor | ![]() Tall Slim Actor |
Drag the default_run animation (skeleton asset) of the SK_Human asset (Source Actor) into the Action List of the SK_EliteSoldier01 asset (Short Bulky Actor).
Specifying Reference Skeletons
Specify the correct reference skeleton file for this animation to provide a suitable reference pose for Runtime Retargeting.
Double-click the default_run animation asset of the SK_EliteSoldier01 Actor in the Actor Editor to open the Animation Editor.
Change the Skeleton File of the default_run animation to the skeleton SK_Human_tpose.xskt of the SK_Human Actor to configure a correct reference skeleton for it in the Asset Details panel of the Animation Editor.
After specifying:
Retargeting Settings Disabled
Compared with the Source Actor, the skeleton sizes of the Short Bulky Actor and the Tall Slim Actor are not the same. After reusing the running animation based on the skeleton size of the Source Actor, the effect is not as good as expected, the Short Bulky Actor is elongated and the Tall Slim Actor is compressed, which can be further adjusted by modifying the Retargeting Modes.
![]() Source Actor | ![]() Short Bullky Actor | ![]() Tall Slim Actor |
Retargeting Settings Enabled
The problem caused by the different sizes of the Actors can be solved by modifying the following four Retargeting Modes to change the bone translation and scaling.
When the Retargeting Mode is Animation, it means that the bone translation is taken from the animation and no retargeting is performed.
Retargeting Mode | Description |
---|---|
Skeleton | Bone translation is taken from the target skeleton. |
Animation Scaled | Correct the translation sampled from the animation based on the length ratio of the bone in the target skeleton and the animation reference skeleton. |
Orient And Scale | Correct the translation sampled from the animation based on the orientation difference and length ratio of the bone in the target skeleton and the animation reference skeleton. |
Anim Relative | Correct the transform sampled from the animation based on differences in translation, rotation, and scaling of bones between the target skeleton and the animation reference skeleton. |
In the Skeleton Editor, select Animation Scaled in the drop-down box on the right side of the Bip01 bone to set its Retargeting Mode to Animation Scaled, while the Retargeting Modes of the remaining bones are all Skeleton.
The SK_EliteSoldier02 asset can also reuse the default_run animation of the SK_Human asset as described above.
Final Effect
Both the SK_EliteSoldier01 and SK_EliteSoldier02 assets reuse the default_run animation of the SK_Human asset when using the Runtime Retargeting feature.