|
本页面的内容:
Overview
Getting Started
Retargeting Adjustments
Retargeting an Animation Blueprint
Retargeting a Base Pose
Note: This feature is not available before Engine Version 4.5
Overview
Animation Retargeting (Different Skeletons) is a feature that allows animations to be reused between characters that do not share the same Skeleton asset, unlike 动画重定向 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 HeroTPP_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.
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:
Inside the Content Browser under the Game/AnimStarterPack/Character folder, open the HeroTPP_Skeleton asset.
Click the Retarget Manager button, then under Set up Rig, click the Pick Asset icon and select the Humanoid Rig.
Duplicate Anim Assets and Retarget.
In the Select Skeleton window, you should see your Skeleton in the upper portion of the window, select it and click Select.
A copy of the animation you selected to retarget will be created in the same folder of your Target Skeleton.
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:
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:
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.
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.
The Select Skeleton window will appear. Select your Target Skeleton and press Select.
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.
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.
Our Source Skeleton on the left is in a T-Pose while our Target Skeleton is using an A-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.
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.
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.
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.
Retargeting the animation with the retargeted Base Pose, results in a better looking animation.
|
|