Retarget a Rokoko animation to a Metahuman in Unreal Engine 5

Who is this article relevant to?

This article is for anyone who wants to know how to retarget their exported Rokoko Studio animations to their Metahuman in Unreal Engine 5

Which plans is this article relevant for?

Starter Plus Pro Enterprise

Important! For any workflow-related issues, please join our Discord server.

Requirements

  • A Rokoko Studio animation in FBX format
  • A Metahuman
  • Unreal Engine 5

Important

The official Epic Games Guide for retargeting animations on Metahumans in Unreal Engine 5 can be found here. Most of the steps in this article will be the same as in the official Epic guide for retargeting. We will just point out some details that are important for using Rokoko animations as well.

It's important that you follow the official Epic guide first and come back to this article for the small details that you will need to check.

Before we start retargeting

  1. Create a new Unreal Engine project based on the Third Person Template.
  2. Download a MetaHuman and import them into your project from Quixel Bridge. Default Metahumans and Custom Metahumans work the same. We will use a Custom one for this one.

Workflow

The workflow consists of the following steps:

  1. Set up the MetaHuman IK Rig to use the correct preview mesh.

  2. Create and configure a UE4 Mannequin to MetaHuman IK Retargeter Asset.

  3. Select an Animation Asset to retarget, then export it as a new retargeted Asset.

  4. Configure the retargeted Animation Asset to use the correct Skeletal Mesh for your MetaHuman.

Set Up the MetaHuman IK Rig

  1. In the Content Browser, search for the IK_MetaHuman IK Rig. By default, this Asset is located in the MetaHumans/Common/Common folder.

  2. Double-click the IK_MetaHuman IK Rig to open it.

  3. In the Preview Scene Settings panel on the right, set the Preview Mesh property to the m_med_nrw_preview Skeletal Mesh. If you are using a female Metahuman use the f_med_nrw_preview - f stands for female

    Capture.PNG

     

  4. Save and close this Asset.

Create and Configure an IK Retargeter Asset

    1. In the Content Browser, search for the RTG_UE4Manny_UE5Manny IK Retargeter Asset. By default, this Asset is located in the Characters/Mannequin_UE4/Rigs folder.

    2. Right-click the RTG_UE4Manny_UE5Manny Asset and, from the context menu, select Duplicate. Name the duplicated Asset RTG_UE4Manny_MetaHuman.

    3. Double-click the RTG_UE4Manny_MetaHuman Asset to open it. The Viewport shows you the UE4 and UE5 Mannequins overlapping, and you have several panels to configure retargeting settings on the right. If they do not overlap, don't change anything.

      CaptureV.PNG

       

    4. In the Details panel on the right, from the Target IKRig Asset drop-down, select IK_MetaHuman. This replaces the UE5 Mannequin in the Viewport with an untextured MetaHuman body mesh.

      Selecting the MetaHuman IK Rig
    5. In the Details panel on the right, from the Target Preview Mesh drop-down, search for and select the preview mesh that corresponds to your MetaHuman.

      As a reminder, all MetaHuman Skeletal Meshes follow the same naming convention: gender-presentation_height_weight_mesh-purpose. This tutorial uses a Male Metahuman Preset, whose attributes are as follows:

      • gender-presentation: m
      • height: med
      • weight: nrw

      Preview meshes have the \_preview suffix.

      For this tutorial, the mesh you’re looking for is named m_medium_nrw_preview. Search for it in the dropdown and select it.

      Selecting a preview mesh
    6. In the Chain Mapping panel on the right, make sure the following properties are set to None:

      • LeftPinkyMetacarpal
      • LeftMiddleMetacarpal
      • LeftRingMetacarpal
      • LeftIndexMetacarpal
      • LeftLowerArmTwist02
      • LeftUpperArmTwist02
      • RightPinkyMetacarpal
      • RightRingMetacarpal
      • RightMiddleMetacarpal
      • RightIndexMetacarpal
      • RightLowerArmTwist02
      • RightUpperArmTwist02

      CaptureO.PNG

      At this point, you should see the UE4 Mannequin and the MetaHuman Skeletal Mesh in the Viewport, overlapping. Both meshes should be using the same A-pose.

    7. If the MetaHuman pose is incorrect, make sure you selected the \_preview Skeletal Mesh, not the \_body Skeletal Mesh.

Export an animation from Rokoko Studio

A sample Rokoko animation can be found attached at the end of this guide.

  1. Open Rokoko Studio
  2. Right-click on the animation you want to export and click "Add to export list"

    Capture.PNG

  3. Select the Unreal Engine 4 skeleton alongiside the other default export details:

    Capture.PNG

Import and Choose an Animation Asset

  1. In Unreal Engine, click Import and select the animation you want.

    Capture.PNG

  2. The most important detail is to select the UE skeleton that is comaptible for the retargeting. If you omit this step, then you won't see the animation in the animation list and you won't be able to select it for retargeting.

    Also, make sure to select the other important details such as T0 as ref Pose and Import animations

    Capture.PNG
  3. Still working with the RTG_UE4Manny_MetaHuman Asset in the editor, click the Asset Browser tab. This opens the Asset Browser panel, which contains all animations that are compatible with the source Skeleton. You should see the animation we just imported as well.

    The Asset Browser only shows animations compatible with the skeleton used by the source Skeletal Mesh. If your Unreal Engine project contains multiple copies of the same Skeletal Mesh, you need to set up the skeletons used by each copy to be compatible with each other.

    https://support.rokoko.com/hc/en-us/articles/19390947288465-Retarget-a-Rokoko-animation-to-a-Metahuman-in-Unreal-Engine-5-

Separate the Meshes in the Viewport

If your meshes are overlapping, in the Details panel, set the X coordinate of the Target Mesh Offset option to a value that separates the Source and Target preview meshes and leaves enough distance between them to clearly observe the animation playing. In the GIF below, we set this value to 150

Preview the Animation

In the Asset Browser, double-click an Animation Asset to preview it in the Viewport. This tutorial uses the Samurai_Strike_ue_Anim animation. You should now see the animation playing in the Viewport:

ezgif.com-crop(1).gif

Export the Retargeted Animation

Click Export Selected Animations to export your animation.

Capture.PNG

This will create a new Animation Asset targeted to the MetaHuman Skeleton. Select the location where you want to save the new Asset, then click OK.

You can now close the IK Retargeter Editor window.

Configure the Retargeted Animation Asset

In the Content Browser, locate the retargeted Animation Asset and double-click it to open it in the Animation Editor.

Make sure that the Retarget Source Asset (1) and Preview Mesh (Animation) (2) properties highlighted in the screenshot below are set to your MetaHuman’s Skeletal Mesh:

In the project we prepared, we could not select the Metahuman Skeletal Mesh for the Preview Mesh. This has not shown any potential issues for the time being.

Capture6.PNG
After you configure these properties, Save the Animation Asset and close this window.

Final Result

You now have an Animation Asset targeted to your MetaHuman’s Skeleton that works with their specific body height and body type. You can quickly test your animation by assigning it to your MetaHuman’s Body component in the BP_(MetaHumanName) Blueprint. The final result is shown below.

ezgif.com-crop(2).gif

Right-click > Open image in New tab to view in full

Articles in this section

Knowledge base