FRetargetMap
Animation retargeting — replays a pose authored on one skeleton onto another with the same (or partially matching) bone NAMES but different proportions and rest orientations.
- Module
- Animation
- Header
#include "Animation/Retargeting.h"- Namespace
Mowo
Per matched bone the source's local rotation is expressed as a delta from its own rest pose and re-applied over the TARGET's rest pose: targetLocalRot = targetRestRot * (srcRestRot^-1 * srcLocalRot) Translations always stay the target's rest values (bone lengths are a property of the target rig), except the root whose animated offset is scaled by the rigs' height ratio so walk cycles don't foot-slide.
Public functions
| Returns | Name | Description |
|---|---|---|
bool | Build | Builds name-matched pairs and captures both rest poses. |
bool | BuildWithOptions | As Build, with name-remap rules and translation modes. |
bool | IsValid | |
uint32_t | MatchedCount | |
float | HeightRatio | |
void | Retarget | sourceLocals.size() must equal the source skeleton's bone count; outTargetLocals is resized to the target's count. |
void | Retarget | As above, then places every authored chain's end effector: the source effector's offset from its chain start, scaled by the height ratio, is reproduced from the TARGET chain's start and solved for with FABRIK. |
uint32_t | ChainCount |
Function details
Build
bool Build(const Skeleton& source, const Skeleton& target, float heightRatio = 0.0f)Builds name-matched pairs and captures both rest poses. Unmatched target bones keep their rest transform on retarget. heightRatio defaults to targetHeight/sourceHeight measured from rest-pose bone positions (max |y| extent); pass a positive value to override.
BuildWithOptions
bool BuildWithOptions(const Skeleton& source, const Skeleton& target, const FRetargetOptions& options, float heightRatio = 0.0f)As Build, with name-remap rules and translation modes. options may outlive the call or not — everything needed is captured.
IsValid
bool IsValid() constMatchedCount
uint32_t MatchedCount() constHeightRatio
float HeightRatio() constRetarget
void Retarget(const std::vector<Mat4>& sourceLocals, std::vector<Mat4>& outTargetLocals) constsourceLocals.size() must equal the source skeleton's bone count; outTargetLocals is resized to the target's count.
Retarget
void Retarget(const std::vector<Mat4>& sourceLocals, const Skeleton& sourceSkeleton, const Skeleton& targetSkeleton, std::vector<Mat4>& outTargetLocals) constAs above, then places every authored chain's end effector: the source effector's offset from its chain start, scaled by the height ratio, is reproduced from the TARGET chain's start and solved for with FABRIK. Needs both skeletons because the hierarchy walk and the solver do — the rotation-only overload above deliberately needs neither.
ChainCount
uint32_t ChainCount() const