public sealed class SkeletonRetargetMoves an animation from the skeleton it was authored on to another one: same motion, the target rig's proportions.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The transfer is in model space and relative to each rig's bind pose. For every mapped joint, the source's model-space rotation is measured against its own bind pose — that difference is what the animation does, with the rig's resting shape divided out — and the same difference is applied to the target's bind pose. A clip authored on an A-pose rig therefore plays correctly on a T-pose one, which is the case the whole construction exists for.
Why not the local-space shortcut. The cheap version takes the source's difference from bind in its own local space and applies it to the target's local bind. It is per-joint, needs no chain, and would let a clip be retargeted channel by channel with its keys preserved. It is also wrong whenever the two rigs' bind poses differ by a rotation anywhere up the chain, because the difference is then expressed in a parent frame the target does not share — the elbow bends about the wrong axis by however much the two shoulders disagree. That is exactly the A-pose-to-T-pose case, so the shortcut fails at the only job worth doing.
Only one joint moves. Every other mapped joint keeps the target rig's own bone lengths and takes rotation alone; the pelvis takes the source's model-space displacement scaled by TranslationScale, so a character half the height travels half as far and its feet still meet the ground.
Not thread-safe: the model-space working buffers belong to the instance. One per animator, like every other per-character object here.
Fields and properties (2)
public RetargetMap MapWhich joint drives which.
public float TranslationScaleHow much of the source's movement the target takes, as a ratio of their proportions.
Methods (3)
public SkeletonRetarget(RetargetMap map)Creates a retarget for a mapping.
public void Apply(ReadOnlySpan<BoneTransform> sourcePose, Span<BoneTransform> targetPose)Retargets one pose.
public AnimationClip Bake(AnimationClip clip, float sampleRate = 30)Retargets a whole clip, producing one baked against the target skeleton.
Used by (1)
- RetargetingTestsVixen.Animation.Tests