Language:
Page Info
Engine Version:

Animation Retargeting (Different Skeletons)

Choose your OS:

Retarget1_1.jpg

Note: This feature is not available before Engine Version 4.5

Animation Retargeting (Different Skeletons) is a feature that allows animations to be reused between characters that do not share the same Skeleton asset, unlike Animation Retargeting which involves retargeting animations between characters that share the same Skeleton asset.

The process of retargeting animations between characters that have different Skeletons uses an asset called a Rig to pass Bone information from one Skeleton to another. After selecting your Rig, you will share it between your Source Skeleton and a Target Skeleton (the Skeleton you wish to retarget animations to). Once you have done so, you will then match up the Target Skeleton's Bones to the Nodes stored in the Rig.

Once all the Bones in the Target Skeleton have been setup in the Rig, you can then retarget animations that are used by your Source Skeleton to your Target Skeleton. You can even retarget entire Animation Blueprints along with all its associated data, which saves time if you want to quickly move all animation assets from one Skeleton to another.

Getting Started

In order to get started with animation retargeting between different skeletons, you will need to select a Rig asset for both Skeletons to share. This section will show you how to access the Humanoid Rig that comes as part of the Engine Content and assign it for use.

We are also going to use two asset packs that are available for free via the Marketplace that have multiple skeletons and animations in it that we can use to retarget. If you have two Skeleton Assets ready to use, you can skip the note below and use your assets. If you do not, you can follow along with the steps by adding the two packs outlined in the note below.

In this example, we are using the following assets which are available for download via the Marketplace.

  • The Source Skeleton we are using is the UE4_Mannequin_Skeleton that is included in the Animation Starter Pack.

  • The Target Skeleton we are using is the SWAT_Skeleton that is included in the Mixamo Character Pack.

Once you have installed the packs above, you can add them to a project via the Add to project button in the Unreal Launcher.

AnimationStarterpack2.jpg

The Animation Starter Pack includes several animations that we will retarget for a character from the Mixamo Character Pack.

Also, your version of Unreal Engine 4 may vary from the one depicted above.

The steps below will show you how to access the default Rig and retarget animations:

  1. Inside the Content Browser under the Game/AnimStarterPack/UE4_Mannequin/Mesh folder, open the UE4_Mannequin_Skeleton asset.

  2. Click the Retarget Manager button, then under Set up Rig, click the Select Rig dropdown and select Select Humanoid Rig.

    Click image for full view.

  3. Click Save then close the window.

  4. In the Content Browser under the Game/MixamoAnimPack/Mixamo_SWAT/Anims folder, open the SWAT_Skeleton asset.

  5. Click the Retarget Manager button, then under Set up Rig, click the Select Rig dropdown and select Select Humanoid Rig.

    Click image for full view.

  6. With the Rig assigned, next you will need to match up the Bones from the Target to the Nodes on the Rig.

    Retarget7.png

  7. Use the drop-down menus to select the Bones on the Skeleton that are similar in location to the Bones (Nodes) on the Rig.

    Click image for full view.

    In the image above, on the left is our Source Skeleton (with Show Bone Names enabled) and on the right is the Target Skeleton (also with Show Bone Names enabled). In the center is the Set up Rig window and we are specifying which Bones from our Target Skeleton are the same (or similar to in location) as the Bones on our Source Skeleton.

    While the naming conventions for each Skeleton may differ, you can see where each bone is on each Skeleton and match them up accordingly. You do not need to specify all Bones and some tweaking may be needed based on your needs.

  8. Continue to specify each Bone from the Target Skeleton to a corresponding Node on the Rig.

    The table below demonstrates the setup for the UE4_Mannequin_Skeleton and SWAT_Skeleton

    Node (Rig)

    Bone (Skeleton)

    Root

    None

    Pelvis

    Hips

    spine_01

    Spine

    spine_02

    Spine1

    spine_03

    Spine2

    clavicle_l

    LeftShoulder

    upperarm_l

    LeftArm

    lowerarm_l

    LeftForeArm

    hand_l

    LeftHand

    clavicle_r

    RightShoulder

    upperarm_r

    RightArm

    lowerarm_r

    RightForeArm

    hand_r

    RightHand

    neck_01

    Neck1

    head

    head

    thigh_l

    LeftUpLeg

    calf_l

    LeftLeg

    foot_l

    LeftFoot

    thigh_r

    RightUpLeg

    calf_r

    RightLeg

    foot_r

    RightFoot

    There are two configurations that can be used when setting up the Rig, Base or Advanced. The Base Configuration (denoted in the chart above) uses the key elements that are needed to ensure the animation is successfully retargeted. The Advanced Configuration allows you to include and specify additional Bones that should be included as part of the retargeting process.

    In the example above, the left and right hands were included as part of the retargeting process however individual fingers were not. Retargeting an animation with the Base Configuration will ensure that the base motion is copied to the new Skeleton, however if the Source Skeleton had animated fingers and the Target did not, the retargeted animation would not animate the fingers and you would have stiff looking hands.

  9. Click the Show Advanced button to toggle Advanced configuration.

    RetargetAdd4.png

  10. Specify Bones from the Target Skeleton to a Node on the Rig for the Advanced Configuration.

    Node (Rig)

    Bone (Skeleton)

    index_01_l

    LeftHandIndex1

    index_02_l

    LeftHandIndex2

    index_03_l

    LeftHandIndex3

    middle_01_l

    LeftHandMiddle1

    middle_02_l

    LeftHandMiddle2

    middle_03_l

    LeftHandMiddle3

    pinky_01_l

    LeftHandPinky1

    pinky_02_l

    LeftHandPinky2

    pinky_03_l

    LeftHandPinky3

    ring_01_l

    LeftHandRing1

    ring_02_l

    LeftHandRing2

    ring_03_l

    LeftHandRing3

    thumb_01_l

    LeftHandThumb1

    thumb_02_l

    LeftHandThumb2

    thumb_03_l

    LeftHandThumb3

    lowerarm_twist_01_l

    LeftHand

    upperarm_twist_01_l

    LeftArm

    index_01_r

    RightHandIndex1

    index_02_r

    RightHandIndex2

    index_03_r

    RightHandIndex3

    middle_01_r

    RightHandMiddle1

    middle_02_r

    RightHandMiddle2

    middle_03_r

    RightHandMiddle3

    pinky_01_r

    RightHandPinky1

    pinky_02_r

    RightHandPinky2

    pinky_03_r

    RightHandPinky3

    ring_01_r

    RightHandRing1

    ring_02_r

    RightHandRing2

    ring_03_r

    RightHandRing3

    thumb_01_r

    RightHandThumb1

    thumb_02_r

    RightHandThumb2

    thumb_03_r

    RightHandThumb3

    lowerarm_twist_01_r

    RightHand

    upperarm_twist_01_r

    RightArm

    calf_twist_01_l

    None

    ball_l

    LeftToeBase

    thigh_twist_01_l

    LeftUpLeg

    calf_twist_01_r

    None

    ball_r

    RightToeBase

    thigh_twist_01_r

    RightUpLeg

    You may encounter situations where there may be additional Bones in one Skeleton that are not included in the other; you can omit these as adjustments can be made to the Target Skeleton to account for this.

    For this example, you can also leave the IK bones to None on the Mixamo character as IK retargeting is still in development.

  11. In the Content Browser, under Game/AnimStarterPack, select an animation that you want to retarget to the new Skeleton.

  12. Right-click on the animation and choose Retarget Anim Assets -> Duplicate Anim Assets and Retarget.

    RT_DuplicateAnim.jpg

  13. In the Select Skeleton window, you should see your Skeleton in the upper portion of the window, select it and click Select.

    Retarget11_2.jpg

  14. A copy of the animation you selected to retarget will be created in the same folder of your Target Skeleton.

    Retarget12.png

    This new animation can now be used with your character.

Retargeting Adjustments

When setting up a Rig to share between Skeletons, you may encounter situations when one Skeleton has additional Bones that the other does not have (in the Getting Started section, if you used Skeletons specified in the example, you may have noticed extra Bones in the Mixamo Skeleton's hands for example). This can sometimes cause issues but can be fixed by recursively setting translation retargeting to the Skeleton.

For example, here is a shot before adjustments:

Retarget13.png

Notice how the fingers appear contorted due to the extra Bone not specified during the Rig set up.

Here is an example after adjustments were made:

Retarget15.png

You can specify Bone Translation Retargeting through the Skeleton Tree view. Here we are Right-clicking on the last digit in each finger and setting Bone Translation to Recursively Set Translation Retargeting Skeleton.

Retarget14.png

Retargeting an Animation Blueprint

Once you have gone through the process of setting up a Rig for two Skeleton assets to share, if there is an Animation Blueprint associated with the Source Skeleton, you can select to retarget it for use with your Target Skeleton.

Right-click on an Animation Blueprint and select the Retarget Anim Blueprints -> Duplicate Anim Blueprints and Retarget option.

RT_AnimBP.jpg

The Select Skeleton window will appear. Select your Target Skeleton and press Select.

Retarget11_2.jpg

All the assets associated with the Animation Blueprint (Animation assets, Blend Spaces, etc.), along with any logic defined in the Animation Blueprint itself will be copied and placed in the same location as your Target Skeleton.

Retarget17.png

Retargeting a Base Pose

There may be instances where you want to retarget animations to a Skeleton that is not quite using the same base pose as your Source Skeleton.

Take for example the Skeleton in the image below on the right.

Retarget2_2.jpg

Our Source Skeleton on the left is in a A-Pose while our Target Skeleton is using an T-Pose. Even though a Rig has been set up for them to share, if we were to retarget animations as is now, we may encounter issues as seen below.

Retarget19.png

In the image above, an animation has been retargeted for our Target Skeleton; however his arms clip into his side because the base poses were not the same. Thankfully, you can also retarget the Base Pose of your Target Skeleton prior to retargeting animations to reduce or eliminate issues like this from occurring.

In your Target Skeleton, under Retarget Manager, there is an option called Manage Retarget Base Pose.

Retarget20.png

If you click the View Pose button, you will see the current Base Pose. You can adjust it by clicking on a Bone and using the Rotation (E) widget.

Retarget21.png

In the image above, the right arm has been adjusted while the left arm is using the default base pose (which we can adjust by using the rotation widget). Once you have adjusted the pose, you can click the Save Pose option to save the retargeted Base Pose. With similar Base Poses between Skeletons, you can now retarget an animation and when the Skeleton Select window appears, you will notice that your Target Skeleton is now using a retargeted Base Pose.

Retarget2_2.jpg

Retargeting the animation with the retargeted Base Pose, results in a better looking animation.

Retarget23.png