class

FRetargetAsset

The authored .retarget — UE's IK Retargeter asset. It carries what the runtime FRetargetOptions carries (the name map, the prefix strips, the translation modes and the chains) plus what only an authoring surface can hold: which two skeletons the pair was built for, the root's travel rules, per-chain FK/IK switches and the retarget poses.

Module
Animation
Header
#include "Animation/RetargetAsset.h"
Namespace
Mowo

The file it writes is the same MDF document FRetargetSerializer reads — the mapping nodes keep their v1 names and shapes, and the additions sit beside them — so a scene's RetargetComponent keeps resolving an asset this editor saved. Everything past the mapping (root mode, FK gating, the poses) is honoured by the evaluation here and by the export; the runtime map has no seam for them yet.

Every list is serialized SORTED by its key: two of the tables were hash maps before this asset existed, and a file whose bytes reshuffle between saves defeats both the undo dedupe and the round-trip check.

Properties

TypeNameDescription
static constexpr uint32_tkSchemaVersionDefault 2.
std::stringsourceSkeletonPath
std::stringtargetSkeletonPath
std::vector<FRetargetBonePair>boneMap
std::vector<std::string>sourcePrefixStrips
std::vector<std::string>targetPrefixStrips
ERetargetTranslationModedefaultTranslationDefault ERetargetTranslationMode::Skeleton.
std::vector<FRetargetBoneTranslation>perBoneTranslation
FRetargetRootSettingsroot
std::vector<FRetargetChainMapping>chains
std::vector<FRetargetPoseAdjustment>sourcePose
std::vector<FRetargetPoseAdjustment>targetPose

Public functions

ReturnsNameDescription
FRetargetOptionsToOptionsThe options a RetargetComponent consumes.
std::stringSerializeToString
boolDeserializeFromString
boolSaveToFile
boolLoadFromFile
std::stringMatchBoneThe target bone a source bone name maps to, or empty when nothing matches or more than one target does.
uint32_tAutoMapBonesAdds a pair for every unmapped source bone that MatchBone resolves to a target no other pair claims.
uint32_tAutoMapChainsFills the target ends of every chain that names its source ends and leaves the target ones empty: an authored pair for the source bone wins, otherwise MatchBone decides.
Ref<Skeleton>MakeAdjustedSkeletonA copy of base with the adjustments applied to its rest pose.
boolPrepareRefs rather than references because the evaluation keeps both rigs alive: a reimport frees a model's skeleton in place, and a map built over a dangling one would be read on the next frame.
voidRetargetPosesourceLocals are the SOURCE skeleton's local transforms (what AnimationSampler::Sample produces against eval.sourceBase); outTargetLocals come back sized to the target.
Ref<AnimationClip>RetargetClipThe whole clip, sampled once per tick of the source clip and re-keyed on the target's bones.
const char*RootModeName
ERetargetRootModeRootModeFromName
const char*TranslationModeName
ERetargetTranslationModeTranslationModeFromName

Function details

ToOptions

C++
FRetargetOptions ToOptions(const Skeleton* target = nullptr) const

The options a RetargetComponent consumes. A disabled IK chain is written with weight 0, which the runtime already treats as rotation-only. With a target skeleton the per-chain translation modes expand to per-bone entries over the chain's bones; without one they cannot.

SerializeToString

C++
std::string SerializeToString() const

DeserializeFromString

C++
bool DeserializeFromString(const std::string& text)

SaveToFile

C++
bool SaveToFile(const std::string& path) const

LoadFromFile

C++
bool LoadFromFile(const std::string& path)

MatchBone

C++
static std::string MatchBone(const std::vector<std::string>& targetBones, const std::string& sourceBone, const std::vector<std::string>& sourceStrips, const std::vector<std::string>& targetStrips)

The target bone a source bone name maps to, or empty when nothing matches or more than one target does. Names are compared after the prefix strips, case-folded, split into tokens at separators and camel humps, with "left"/"right" folded to a side token that has to agree — a hand never lands on the other hand, and "arm" against a rig with an upper and a lower arm is left for a human rather than guessed.

AutoMapBones

C++
uint32_t AutoMapBones(const Skeleton& source, const Skeleton& target)

Adds a pair for every unmapped source bone that MatchBone resolves to a target no other pair claims. Existing pairs are kept. Returns how many pairs were added.

AutoMapChains

C++
uint32_t AutoMapChains(const Skeleton& source, const Skeleton& target)

Fills the target ends of every chain that names its source ends and leaves the target ones empty: an authored pair for the source bone wins, otherwise MatchBone decides. Returns how many chain ends were filled.

MakeAdjustedSkeleton

C++
static Ref<Skeleton> MakeAdjustedSkeleton(const Skeleton& base, const std::vector<FRetargetPoseAdjustment>& adjustments)

A copy of base with the adjustments applied to its rest pose. The bone list and hierarchy are unchanged, so a pose sampled against the base still lines up with it index for index.

Prepare

C++
bool Prepare(const Ref<Skeleton>& source, const Ref<Skeleton>& target, FRetargetEvaluation& out) const

Refs rather than references because the evaluation keeps both rigs alive: a reimport frees a model's skeleton in place, and a map built over a dangling one would be read on the next frame.

RetargetPose

C++
void RetargetPose(const FRetargetEvaluation& eval, const std::vector<Mat4>& sourceLocals, std::vector<Mat4>& outTargetLocals) const

sourceLocals are the SOURCE skeleton's local transforms (what AnimationSampler::Sample produces against eval.sourceBase); outTargetLocals come back sized to the target. The runtime map's answer, then the root settings and the per-chain FK gating this asset adds.

RetargetClip

C++
Ref<AnimationClip> RetargetClip(const FRetargetEvaluation& eval, const AnimationClip& sourceClip, const std::string& outName) const

The whole clip, sampled once per tick of the source clip and re-keyed on the target's bones. Null when the evaluation is not valid.

RootModeName

C++
static const char* RootModeName(ERetargetRootMode mode)

RootModeFromName

C++
static ERetargetRootMode RootModeFromName(const std::string& name)

TranslationModeName

C++
static const char* TranslationModeName(ERetargetTranslationMode mode)

TranslationModeFromName

C++
static ERetargetTranslationMode TranslationModeFromName(const std::string& name)
Generated from Animation/RetargetAsset.h via animation.json · Oct 26, 2026Version 1.0.0