Class SkeletonRetargeter
Namespace: ValveResourceFormat.ResourceTypes.ModelAnimation
Assembly: ValveResourceFormat.dll
Retargets animation posed on one skeleton onto another skeleton by bone name, reproducing the source skeleton's world-space poses on the target hierarchy. Used for animation graph (NM) clips, whose frames target a skeleton separate from the model's.
public sealed class SkeletonRetargeterInheritance
Constructors
SkeletonRetargeter(Skeleton, Skeleton)
Builds the model-to-source bone map by bone name, once per skeleton pair.
public SkeletonRetargeter(Skeleton modelSkeleton, Skeleton sourceSkeleton)Parameters
modelSkeleton Skeleton
sourceSkeleton Skeleton
Properties
HasMappedBones
Gets whether any model bone maps to a source bone by name; retargeting produces the bind pose when nothing maps.
public bool HasMappedBones { get; }Property Value
SourceSkeleton
Gets the source skeleton the retargeted animation is decoded on.
public Skeleton SourceSkeleton { get; }Property Value
Methods
Retarget(Frame, Span<Matrix4x4>)
Reproduces the clip frame's world poses on the model skeleton: mapped model bones take their source bone's world pose, unmapped bones follow their parent at bind pose. modelWorld receives the model skeleton's world transforms, indexed by bone index.
public void Retarget(Frame clipFrame, Span<Matrix4x4> modelWorld)Parameters
clipFrame Frame
RetargetSubtree(Bone, Matrix4x4, ReadOnlySpan<Matrix4x4>, Span<Matrix4x4>)
Retargets one model-skeleton subtree from precomputed source world poses: mapped model bones copy their source bone's world pose, unmapped bones follow their parent at bind pose. sourceWorld is indexed by source bone index.
public void RetargetSubtree(Bone bone, Matrix4x4 parentWorld, ReadOnlySpan<Matrix4x4> sourceWorld, Span<Matrix4x4> modelWorld)Parameters
bone Bone
parentWorld Matrix4x4
sourceWorld ReadOnlySpan<Matrix4x4>

