FAnimationRuntime

In AnimationRunTime Library, we extract animation data based on Skeleton hierarchy, not ref pose hierarchy.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/AnimationRuntime.h

Include

#include "AnimationRuntime.h"

Syntax

class FAnimationRuntime

Remarks

In AnimationRunTime Library, we extract animation data based on Skeleton hierarchy, not ref pose hierarchy. Ref pose will need to be re-mapped later

Functions

Name Description

Public function Static

void

 

AccumulateAdditivePose

(
    FCompactPose& BasePose,
    const FCompactPose& AdditivePose,
    FBlendedCurve& BaseCurve,
    const FBlendedCurve& AdditiveCurve,
    float Weight,
    enum EAdditiveAnimationType Additiv...
)

Accumulate Additive Pose based on AdditiveType

Public function Static

void

 

AccumulateLocalSpaceAdditivePose

(
    FCompactPose& BasePose,
    const FCompactPose& AdditivePose,
    FBlendedCurve& BaseCurve,
    const FBlendedCurve& AdditiveCurve,
    float Weight
)

Accumulates weighted AdditivePose to BasePose. Rotations are NOT normalized.

Public function Static

void

 

AccumulateMeshSpaceRotationAdditiveToLocalPose

(
    FCompactPose& BasePose,
    const FCompactPose& MeshSpaceRotat...,
    FBlendedCurve& BaseCurve,
    const FBlendedCurve& AdditiveCurve,
    float Weight
)

Accumulate a MeshSpaceRotation Additive pose to a local pose. Rotations are NOT normalized

Public function Static

ETypeAdvance...

 

AdvanceTime

(
    const bool& bAllowLooping,
    const float& MoveDelta,
    float& InOutTime,
    const float& EndTime
)

Advance CurrentTime to CurrentTime + MoveDelta.

Public function Static

void

 

AppendActiveMorphTargets

(
    const USkeletalMesh* InSkeleta...,
    const TMap< FName, float >& InMorp...,
    TArray< FActiveMorphTarget >& InOu...,
    TArray< float >& InOutMorphTargetW...
)

Combine CurveKeys (that reference morph targets by name) and ActiveAnims (that reference morphs by reference) into the ActiveMorphTargets array.

Public function Static

void

 

ApplyWeightToTransform

(
    const FBoneContainer& RequiredBone...,
    FTransformArrayA2& Atoms,
    float Weight
)

Apply Weight to the Transform Atoms = Weight * Atoms at the end

Public function Static

void

 

BlendPosesPerBoneFilter

(
    FCompactPose& BasePose,
    const TArray< FCompactPose >& Blen...,
    FBlendedCurve& BaseCurve,
    const TArray< FBlendedCurve >& Ble...,
    FCompactPose& OutPose,
    FBlendedCurve& OutCurve,
    TArray< FPerBoneBlendWeight >& Bon...,
    EBlendPosesPerBoneFilterFlags blend...,
    enum ECurveBlendOption::Type CurveB...
)

Blend Poses per bone weights : The BasePoses + BlendPoses(SourceIndex) * Blend Weights(BoneIndex) Please note BlendWeights are array, so you can define per bone base This supports multi per bone blending, but only one pose as blend at a time per track PerBoneBlendWeights.Num() == Atoms.Num()

Public function Static

void

 

BlendPosesTogether

(
    TArrayView< const FCompactPose > So...,
    TArrayView< const FBlendedCurve > S...,
    TArrayView< const float > SourceWei...,
    TArrayView< const int32 > SourceWei...,
    FCompactPose& ResultPose,
    FBlendedCurve& ResultCurve
)

Blends together a set of poses, each with a given weight.

Public function Static

void

 

BlendPosesTogether

(
    TArrayView< const FCompactPose > So...,
    TArrayView< const FBlendedCurve > S...,
    TArrayView< const float > SourceWei...,
    FCompactPose& ResultPose,
    FBlendedCurve& ResultCurve
)

Blends together a set of poses, each with a given weight.

Public function Static

void

 

BlendPosesTogetherIndirect

(
    TArrayView< const FCompactPose*...,
    TArrayView< const FBlendedCurve...,
    TArrayView< const float > SourceWei...,
    FCompactPose& ResultPose,
    FBlendedCurve& ResultCurve
)

Blends together a set of poses, each with a given weight.

Public function Static

void

 

BlendPosesTogetherPerBone

(
    TArrayView< const FCompactPose > So...,
    TArrayView< const FBlendedCurve > S...,
    const IInterpolationIndexProvider&...,
    TArrayView< const FBlendSampleData ...,
    TArrayView< const int32 > BlendSamp...,
    FCompactPose& ResultPose,
    FBlendedCurve& ResultCurve
)

Blends together a set of poses, each with a given weight.

Public function Static

void

 

BlendPosesTogetherPerBone

(
    TArrayView< const FCompactPose > So...,
    TArrayView< const FBlendedCurve > S...,
    const IInterpolationIndexProvider&...,
    TArrayView< const FBlendSampleData ...,
    FCompactPose& ResultPose,
    FBlendedCurve& ResultCurve
)

Blends together a set of poses, each with a given weight.

Public function Static

void

 

BlendPosesTogetherPerBoneInMeshSpace

(
    TArrayView< FCompactPose > SourcePo...,
    TArrayView< const FBlendedCurve > S...,
    const UBlendSpaceBase* BlendSp...,
    TArrayView< const FBlendSampleData ...,
    FCompactPose& ResultPose,
    FBlendedCurve& ResultCurve
)

Blends together a set of poses, each with a given weight.

Public function Static

void

 

BlendTransformsByWeight

(
    FTransform& OutTransform,
    const TArray< FTransform >& Transf...,
    const TArray< float >& Weights
)

Blend Array of Transforms by weight

Public function Static

void

 

BlendTwoPosesTogether

(
    const FCompactPose& SourcePose1,
    const FCompactPose& SourcePose2,
    const FBlendedCurve& SourceCurve1,
    const FBlendedCurve& SourceCurve2,
    const float WeightOfPose1,
    FCompactPose& ResultPose,
    FBlendedCurve& ResultCurve
)

Blends together two poses.

Public function Static

void

 

BlendTwoPosesTogetherPerBone

(
    const FCompactPose& SourcePose1,
    const FCompactPose& SourcePose2,
    const FBlendedCurve& SourceCurve1,
    const FBlendedCurve& SourceCurve2,
    const TArray< float >& WeightsOfSo...,
    FCompactPose& ResultPose,
    FBlendedCurve& ResultCurve
)

Blends together a set of poses, each with a given weight.

Public function Static

void

 

CombineWithAdditiveAnimations

(
    int32 NumAdditivePoses,
    const FTransformArrayA2** ...,
    const float* SourceAdditiveWei...,
    const FBoneContainer& RequiredBone...,
    FTransformArrayA2& Atoms
)

Public function Static

bool

 

ContainsNaN

(
    TArray< FBoneIndexType >& Required...,
    FA2Pose& Pose
)

Public function Static

void

 

ConvertBoneSpaceTransformToCS

(
    const FTransform& ComponentTransfo...,
    FCSPose< FCompactPose >& MeshBases,
    FTransform& InOutBoneSpaceTM,
    FCompactPoseBoneIndex BoneIndex,
    EBoneControlSpace Space
)

Convert a FTransform in a specified bone space to ComponentSpace.

Public function Static

void

 

ConvertCSTransformToBoneSpace

(
    const FTransform& ComponentTransfo...,
    FCSPose< FCompactPose >& MeshBases,
    FTransform& InOutCSBoneTM,
    FCompactPoseBoneIndex BoneIndex,
    EBoneControlSpace Space
)

Convert a ComponentSpace FTransform to specified bone space.

Public function Static

void

 

ConvertMeshRotationPoseToLocalSpace

(
    FCompactPose& Pose
)

Convert a MeshSpaceRotation pose to Local Space. Rotations are NOT normalized.

Public function Static

void

 

ConvertPoseToAdditive

(
    FCompactPose& TargetPose,
    const FCompactPose& BasePose
)

Convert TargetPose into an AdditivePose, by doing TargetPose = TargetPose - BasePose

Public function Static

void

 

ConvertPoseToMeshRotation

(
    FCompactPose& LocalPose
)

Convert LocalPose into MeshSpaceRotations. Rotations are NOT normalized.

Public function Static

void

 

ConvertPoseToMeshSpace

(
    const TArray< FTransform >& LocalT...,
    TArray< FTransform >& MeshSpaceTra...,
    const FBoneContainer& RequiredBone...
)

Convert LocalTransforms into MeshSpaceTransforms over RequiredBones.

Public function Static

void

 

ConvertTransformToAdditive

(
    FTransform& TargetTrasnform,
    const FTransform& BaseTransform
)

Convert transform to additive

Public function Static

void

 

CreateMaskWeights

(
    TArray< FPerBoneBlendWeight >& Bon...,
    const TArray< FInputBlendPose >& B...,
    const USkeleton* Skeleton
)

Create Mast Weight for skeleton joints, not per mesh or per required bones You'll have to filter properly with correct mesh joint or required boens The depth should not change based on LOD or mesh or skeleton They still should contain same depth

Public function Static

void

 

EnsureParentsPresent

(
    TArray< FBoneIndexType >& BoneIndi...,
    const FReferenceSkeleton& RefSkele...
)

Utility for taking an array of bone indices and ensuring that all parents are present (ie. all bones between those in the array and the root are present).

Public function Static

void

 

ExcludeBonesWithNoParents

(
    const TArray< int32 >& BoneIndices,
    const FReferenceSkeleton& RefSkele...,
    TArray< int32 >& FilteredRequiredB...
)

Public function Static

void

 

FillUpComponentSpaceTransforms

(
    const FReferenceSkeleton& RefSkele...,
    const TArray< FTransform >& BoneSp...,
    TArray< FTransform >& ComponentSpa...
)

Public function Static

void

 

FillUpComponentSpaceTransformsRefPose

(
    const USkeleton* Skeleton,
    TArray< FTransform >& ComponentSpa...
)

Public function Static

void

 

FillUpComponentSpaceTransformsRetargetBasePose

(
    const USkeletalMesh* Mesh,
    TArray< FTransform >& ComponentSpa...
)

Public function Static

void

 

FillUpComponentSpaceTransformsRetargetBasePose

(
    const USkeleton* Skeleton,
    TArray< FTransform >& ComponentSpa...
)

Public function Static

void

 

FillWithRefPose

(
    TArray< FTransform >& OutAtoms,
    const FBoneContainer& RequiredBone...
)

Fill ref pose

Public function Static

void

 

FillWithRetargetBaseRefPose

(
    FCompactPose& OutPose,
    const USkeletalMesh* Mesh
)

Fill with retarget base ref pose but this isn't used during run-time, so it always copies all of them

Public function Static

FTransform

 

GetComponentSpaceRefPose

(
    const FCompactPoseBoneIndex& Compa...,
    const FBoneContainer& BoneContaine...
)

Get Reference Component Space Transform

Public function Static

FTransform

 

GetComponentSpaceTransform

(
    const FReferenceSkeleton& RefSkele...,
    const TArray< FTransform >& BoneSp...,
    int32 BoneIndex
)

Space bases

Public function Static

FTransform

 

GetComponentSpaceTransformRefPose

(
    const FReferenceSkeleton& RefSkele...,
    int32 BoneIndex
)

Space bases

Public function Static

const FTrans...

 

GetComponentSpaceTransformWithCache

(
    const FReferenceSkeleton& InRefSke...,
    const TArray< FTransform >& InBone...,
    int32 BoneIndex,
    TArray< FTransform >& CachedTransf...,
    TArray< bool >& CachedTransformRea...
)

Calculate the component-space bone transform for the specified bone.

Public function Static

void

 

GetKeyIndicesFromTime

(
    int32& OutKeyIndex1,
    int32& OutKeyIndex2,
    float& OutAlpha,
    const float Time,
    const int32 NumFrames,
    const float SequenceLength
)

Get Key Indices (start/end with alpha from start) with input parameter Time, NumFrames from % from StartKeyIndex, meaning (CurrentKeyIndex(float)-StartKeyIndex)/(EndKeyIndex-StartKeyIndex) by this Start-End, it will be between 0-(NumFrames-1), not number of Pos/Rot key tracks

Public function Static

FTransform

 

GetSpaceTransform

(
    FA2Pose& Pose,
    int32 Index
)

FA2Pose/FA2CSPose Interfaces for template functions.

Public function Static

FTransform

 

GetSpaceTransform

(
    FA2CSPose& Pose,
    int32 Index
)

FA2Pose/FA2CSPose Interfaces for template functions.

Public function Static

int32

 

GetStringDistance

(
    const FString& First,
    const FString& Second
)

Calculate distance how close two strings are.

Public function Static

bool

 

HasWeight

(
    float Weight
)

Public function Static

void

 

InitializeTransform

(
    const FBoneContainer& RequiredBone...,
    FTransformArrayA2& Atoms
)

Public function Static

bool

 

IsFullWeight

(
    float Weight
)

Weight utility functions

Public function Static

void

 

LerpBoneTransforms

(
    TArray< FTransform >& A,
    const TArray< FTransform >& B,
    float Alpha,
    const TArray< FBoneIndexType >& Re...
)

Lerp for BoneTransforms.

Public function Static

void

 

LerpPoses

(
    FCompactPose& PoseA,
    const FCompactPose& PoseB,
    FBlendedCurve& CurveA,
    const FBlendedCurve& CurveB,
    float Alpha
)

Lerp for FCompactPose.

Public function Static

void

 

LerpPosesPerBone

(
    FCompactPose& PoseA,
    const FCompactPose& PoseB,
    FBlendedCurve& CurveA,
    const FBlendedCurve& CurveB,
    float Alpha,
    const TArray< float >& PerBoneWeig...
)

Lerp for FCompactPose.

Public function Static

void

 

LerpPosesWithBoneIndexList

(
    FCompactPose& PoseA,
    const FCompactPose& PoseB,
    FBlendedCurve& CurveA,
    const FBlendedCurve& CurveB,
    float Alpha,
    const TArray< FCompactPoseBoneIndex...
)

Lerp for FCompactPose.

Public function Static

void

 

MakeSkeletonRefPoseFromMesh

(
    const USkeletalMesh* InMesh,
    const USkeleton* InSkeleton,
    TArray< FTransform >& OutBoneBuffe...
)

Public function Static

void

 

NormalizeRotations

(
    const FBoneContainer& RequiredBone...,
    FTransformArrayA2& Atoms
)

Public function Static

void

 

NormalizeRotations

(
    FTransformArrayA2& Atoms
)

Public function Static

void

 

RetargetBoneTransform

(
    const USkeleton* MySkeleton,
    const FName& RetargetSource,
    FTransform& BoneTransform,
    const int32 SkeletonBoneIndex,
    const FCompactPoseBoneIndex& BoneI...,
    const FBoneContainer& RequiredBone...,
    const bool bIsBakedAdditive
)

Retarget a single bone transform, to apply right after extraction.

Public function Static

void

 

SetSpaceTransform

(
    FA2CSPose& Pose,
    int32 Index,
    FTransform& NewTransform
)

Public function Static

void

 

SetSpaceTransform

(
    FA2Pose& Pose,
    int32 Index,
    FTransform& NewTransform
)

Public function Static

void

 

TickBlendWeight

(
    float DeltaTime,
    float DesiredWeight,
    float& Weight,
    float& BlendTime
)

Public function Static

void

 

UpdateDesiredBoneWeight

(
    const TArray< FPerBoneBlendWeight >...,
    TArray< FPerBoneBlendWeight >& Tar...,
    const TArray< float >& BlendWeight...
)

Enums

Name

Description

Public enum

EBlendPosesPerBoneFilterFlags

Blending flags for BlendPosesPerBoneFilter

Deprecated Functions

Name Description

Public function Static

void

 

BlendPosesPerBoneFilter

(
    FCompactPose& BasePose,
    const TArray< FCompactPose >& Blen...,
    FBlendedCurve& BaseCurve,
    const TArray< FBlendedCurve >& Ble...,
    FCompactPose& OutPose,
    FBlendedCurve& OutCurve,
    TArray< FPerBoneBlendWeight >& Bon...,
    bool bMeshSpaceRotationBlend,
    enum ECurveBlendOption::Type CurveB...
)

Please use the BlendPosesPerBoneFilter function that accepts EBlendPosesPerBoneFilterFlags.

Public function Static

void

 

ConvertBoneSpaceTransformToCS

(
    USkeletalMeshComponent* SkelCo...,
    FCSPose< FCompactPose >& MeshBases,
    FTransform& InOutBoneSpaceTM,
    FCompactPoseBoneIndex BoneIndex,
    EBoneControlSpace Space
)

Please use the ConvertBoneSpaceTransformToCS with a transform as the first argument

Public function Static

void

 

ConvertCSTransformToBoneSpace

(
    USkeletalMeshComponent* SkelCo...,
    FCSPose< FCompactPose >& MeshBases,
    FTransform& InOutCSBoneTM,
    FCompactPoseBoneIndex BoneIndex,
    EBoneControlSpace Space
)

Please use the ConvertCSTransformToBoneSpace with a transform as the first argument

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss