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 AdditiveType
)

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& MeshSpaceRotationAdditive,
    FBlendedCurve& BaseCurve,
    const FBlendedCurve& AdditiveCurve,
    float Weight
)

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

Public function Static

ETypeAdvanceAnim

 

AdvanceTime

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

Advance CurrentTime to CurrentTime + MoveDelta.

Public function Static

void

 

AppendActiveMorphTargets

(
    const USkeletalMesh* InSkeletalMesh,
    const TMap< FName, float >& InMorphCurveAnims,
    TArray< FActiveMorphTarget >& InOutActiveMorphTargets,
    TArray< float >& InOutMorphTargetWeights
)

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& RequiredBones,
    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 >& BlendPoses,
    FBlendedCurve& BaseCurve,
    const TArray< FBlendedCurve >& BlendCurves,
    FCompactPose& OutPose,
    FBlendedCurve& OutCurve,
    TArray< FPerBoneBlendWeight >& BoneBlendWeights,
    EBlendPosesPerBoneFilterFlags blendFlags,
    enum ECurveBlendOption::Type CurveBlendOption
)

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 > SourcePoses,
    TArrayView< const FBlendedCurve > SourceCurves,
    TArrayView< const float > SourceWeights,
    TArrayView< const int32 > SourceWeightsIndices,
    FCompactPose& ResultPose,
    FBlendedCurve& ResultCurve
)

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

Public function Static

void

 

BlendPosesTogether

(
    TArrayView< const FCompactPose > SourcePoses,
    TArrayView< const FBlendedCurve > SourceCurves,
    TArrayView< const float > SourceWeights,
    FCompactPose& ResultPose,
    FBlendedCurve& ResultCurve
)

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

Public function Static

void

 

BlendPosesTogetherIndirect

(
    TArrayView< const FCompactPose*const > SourcePoses,
    TArrayView< const FBlendedCurve*const > SourceCurves,
    TArrayView< const float > SourceWeights,
    FCompactPose& ResultPose,
    FBlendedCurve& ResultCurve
)

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

Public function Static

void

 

BlendPosesTogetherPerBone

(
    TArrayView< const FCompactPose > SourcePoses,
    TArrayView< const FBlendedCurve > SourceCurves,
    const IInterpolationIndexProvider* InterpolationIndexProvider,
    TArrayView< const FBlendSampleData > BlendSampleDataCache,
    TArrayView< const int32 > BlendSampleDataCacheIndices,
    FCompactPose& ResultPose,
    FBlendedCurve& ResultCurve
)

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

Public function Static

void

 

BlendPosesTogetherPerBone

(
    TArrayView< const FCompactPose > SourcePoses,
    TArrayView< const FBlendedCurve > SourceCurves,
    const IInterpolationIndexProvider* InterpolationIndexProvider,
    TArrayView< const FBlendSampleData > BlendSampleDataCache,
    FCompactPose& ResultPose,
    FBlendedCurve& ResultCurve
)

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

Public function Static

void

 

BlendPosesTogetherPerBoneInMeshSpace

(
    TArrayView< FCompactPose > SourcePoses,
    TArrayView< const FBlendedCurve > SourceCurves,
    const UBlendSpaceBase* BlendSpace,
    TArrayView< const FBlendSampleData > BlendSampleDataCache,
    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 >& Transforms,
    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 >& WeightsOfSource2,
    FCompactPose& ResultPose,
    FBlendedCurve& ResultCurve
)

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

Public function Static

void

 

CombineWithAdditiveAnimations

(
    int32 NumAdditivePoses,
    const FTransformArrayA2** SourceAdditivePoses,
    const float* SourceAdditiveWeights,
    const FBoneContainer& RequiredBones,
    FTransformArrayA2& Atoms
)

Public function Static

bool

 

ContainsNaN

(
    TArray< FBoneIndexType >& RequiredBoneIndices,
    FA2Pose& Pose
)

Public function Static

void

 

ConvertBoneSpaceTransformToCS

(
    const FTransform& ComponentTransform,
    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& ComponentTransform,
    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 >& LocalTransforms,
    TArray< FTransform >& MeshSpaceTransforms,
    const FBoneContainer& RequiredBones
)

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 >& BoneBlendWeights,
    const TArray< FInputBlendPose >& BlendFilters,
    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 >& BoneIndices,
    const FReferenceSkeleton& RefSkeleton
)

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& RefSkeleton,
    TArray< int32 >& FilteredRequiredBones
)

Public function Static

void

 

FillUpComponentSpaceTransforms

(
    const FReferenceSkeleton& RefSkeleton,
    const TArray< FTransform >& BoneSpaceTransforms,
    TArray< FTransform >& ComponentSpaceTransforms
)

Public function Static

void

 

FillUpComponentSpaceTransformsRefPose

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

Public function Static

void

 

FillUpComponentSpaceTransformsRetargetBasePose

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

Public function Static

void

 

FillUpComponentSpaceTransformsRetargetBasePose

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

Public function Static

void

 

FillWithRefPose

(
    TArray< FTransform >& OutAtoms,
    const FBoneContainer& RequiredBones
)

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& CompactPoseBoneIndex,
    const FBoneContainer& BoneContainer
)

Get Reference Component Space Transform

Public function Static

FTransform

 

GetComponentSpaceTransform

(
    const FReferenceSkeleton& RefSkeleton,
    const TArray< FTransform >& BoneSpaceTransforms,
    int32 BoneIndex
)

Space bases

Public function Static

FTransform

 

GetComponentSpaceTransformRefPose

(
    const FReferenceSkeleton& RefSkeleton,
    int32 BoneIndex
)

Space bases

Public function Static

const FTransform &

 

GetComponentSpaceTransformWithCache

(
    const FReferenceSkeleton& InRefSkeleton,
    const TArray< FTransform >& InBoneSpaceTransforms,
    int32 BoneIndex,
    TArray< FTransform >& CachedTransforms,
    TArray< bool >& CachedTransformReady
)

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& RequiredBones,
    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 >& RequiredBonesArray
)

Lerp for BoneTransforms. Stores results in A. Performs A = Lerp(A, B, Alpha);

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 >& PerBoneWeights
)

Lerp for FCompactPose.

Public function Static

void

 

LerpPosesWithBoneIndexList

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

Lerp for FCompactPose.

Public function Static

void

 

MakeSkeletonRefPoseFromMesh

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

Public function Static

void

 

NormalizeRotations

(
    const FBoneContainer& RequiredBones,
    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& BoneIndex,
    const FBoneContainer& RequiredBones,
    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 >& SrcBoneBlendWeights,
    TArray< FPerBoneBlendWeight >& TargetBoneBlendWeights,
    const TArray< float >& BlendWeights
)

Enums

Name

Description

Public enum

EBlendPosesPerBoneFilterFlags

Blending flags for BlendPosesPerBoneFilter

Deprecated Functions

Name Description

Public function Static

void

 

BlendPosesPerBoneFilter

(
    FCompactPose& BasePose,
    const TArray< FCompactPose >& BlendPoses,
    FBlendedCurve& BaseCurve,
    const TArray< FBlendedCurve >& BlendCurves,
    FCompactPose& OutPose,
    FBlendedCurve& OutCurve,
    TArray< FPerBoneBlendWeight >& BoneBlendWeights,
    bool bMeshSpaceRotationBlend,
    enum ECurveBlendOption::Type CurveBlendOption
)

Please use the BlendPosesPerBoneFilter function that accepts EBlendPosesPerBoneFilterFlags.

Public function Static

void

 

ConvertBoneSpaceTransformToCS

(
    USkeletalMeshComponent* SkelComp,
    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* SkelComp,
    FCSPose< FCompactPose >& MeshBases,
    FTransform& InOutCSBoneTM,
    FCompactPoseBoneIndex BoneIndex,
    EBoneControlSpace Space
)

Please use the ConvertCSTransformToBoneSpace with a transform as the first argument

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback