UAnimSequence

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Animation/AnimSequence.h

Include

#include "Animation/AnimSequence.h"

Syntax

class UAnimSequence : public UAnimSequenceBase

Variables

Name Description

Public variable

TEnumAsByte< en...

 

AdditiveAnimType

Additive animation type.

Protected variable

TArray< FName >

 

AnimationTrackNames

This is name of RawAnimationData tracks for editoronly - if we lose skeleton, we'll need relink them

Public variable

UAssetImportDat...

 

AssetImportData

Importing data and options used for this mesh

Public variable

TArray< FAnimSy...

 

AuthoredSyncMarkers

Authored Sync markers

Public variable

bool

 

bAllowFrameStripping

Allow frame stripping to be performed on this animation if the platform requests it Can be disabled if animation has high frequency movements that are being lost.

Public variable

bool

 

bCompressionInProgress

Are we currently compressing this animation.

Public variable

uint32: 1

 

bDoNotOverrideCompression

Do not attempt to override compression scheme when running CompressAnimations commandlet.

Public variable

bool

 

bEnableRootMotion

If this is on, it will allow extracting of root motion

Public variable

bool

 

bForceRootLock

Force Root Bone Lock even if Root Motion is not enabled

Public variable

bool

 

bNeedsRebake

Public variable

UAnimBoneCompre...

 

BoneCompressionSettings

The bone compression settings used to compress bones in this sequence.

Public variable

bool

 

bRootMotionSettingsCopiedFromMontage

Have we copied root motion settings from an owning montage

Public variable

bool

 

bUseNormalizedRootMotionScale

If this is on, it will use a normalized scale value for the root motion extracted: FVector

Public variable

bool

 

bUseRawDataOnly

Should we be always using our raw data (i.e is our compressed data stale)

Public variable

int32

 

CompressCommandletVersion

Saved version number with CompressAnimations commandlet. To help with doing it in multiple passes.

Public variable

FCompressedAnim...

 

CompressedData

Public variable

float

 

CompressionErrorThresholdScale

Set a scale for error threshold on compression.

Public variable

UAnimCurveCompr...

 

CurveCompressionSettings

The curve compression settings used to compress curves in this sequence.

Public variable

float

 

ImportFileFramerate

The DCC framerate of the imported file. UI information only, unit are Hz

Public variable

int32

 

ImportResampleFramerate

The resample framerate that was computed during import. UI information only, unit are Hz

Public variable

EAnimInterpolat...

 

Interpolation

This defines how values between keys are calculated

Public variable

int32

 

MarkerDataUpdateCounter

Track whether we have updated markers so cached data can be updated.

Protected variable

int32

 

NumFrames

Number of raw frames in this sequence (not used by engine - just for informational purposes).

Protected variable

TArray< struct ...

 

RawAnimationData

Raw uncompressed keyframe data.

Protected variable

FGuid

 

RawDataGuid

Update this if the contents of RawAnimationData changes;.

Public variable

int32

 

RefFrameIndex

Additve reference frame if RefPoseType == AnimFrame

Public variable

UAnimSequence &...

 

RefPoseSeq

Additive reference animation if it's relevant - i.e. AnimScaled or AnimFrame

Public variable

TEnumAsByte< en...

 

RefPoseType

Additive refrerence pose type. Refer above enum type

Public variable

FName

 

RetargetSource

Base pose to use when retargeting

Public variable

TSoftObjectPtr<...

 

RetargetSourceAsset

If RetargetSource is set to Default (None), this is asset for the base pose to use when retargeting.

Public variable

TArray< FTransf...

 

RetargetSourceAssetReferencePose

When using RetargetSourceAsset, use the post stored here

Public variable

TEnumAsByte< ER...

 

RootMotionRootLock

Root Bone will be locked to that position when extracting root motion.

Protected variable

TArray< struct ...

 

SourceRawAnimationData

Source RawAnimationData.

Protected variable

TArray< struct ...

 

TrackToSkeletonMapTable

In the future, maybe keeping RawAnimSequenceTrack + TrackMap as one would be good idea to avoid inconsistent array size TrackToSkeletonMapTable(i) should contains track mapping data for RawAnimationData(i).

Public variable

TArray< FName >

 

UniqueMarkerNames

List of Unique marker names in this animation sequence

Constructors

Name Description

Public function

UAnimSequence

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Protected function

void

 

AddBoneCustomAttribute

(
    const FName& BoneName,
    const FName& AttributeName,
    const TArrayView< const float > Tim...,
    const TArrayView< const DataType > ...
)

Public function

void

 

AddBoneFloatCustomAttribute

(
    const FName& BoneName,
    const FName& AttributeName,
    const TArray< float >& TimeKeys,
    const TArray< float >& ValueKeys
)

Public function

void

 

AddBoneIntegerCustomAttribute

(
    const FName& BoneName,
    const FName& AttributeName,
    const TArray< float >& TimeKeys,
    const TArray< int32 >& ValueKeys
)

Public function

void

 

AddBoneStringCustomAttribute

(
    const FName& BoneName,
    const FName& AttributeName,
    const TArray< float >& TimeKeys,
    const TArray< FString >& ValueKeys
)

Public function

void

 

AddKeyToSequence

(
    float Time,
    const FName& BoneName,
    const FTransform& AdditiveTransfor...
)

Add Key to Transform Curves

Public function

bool

 

AddLoopingInterpolation()

Insert extra frame of the first frame at the end of the frame so that it improves the interpolation when it loops This increases framecount + time, so that it requires recompression

Public function

int32

 

AddNewRawTrack

(
    FName TrackName,
    FRawAnimSequenceTrack* TrackDa...
)

Adds a new track (if no track of the supplied name is found) to the raw animation data, optionally setting it to TrackData.

Public function Static

void

 

AddReferencedObjects

(
    UObject* This,
    FReferenceCollector& Collector
)

Public function

void

 

ApplyCompressedData

(
    const FString& DataCacheKeySuffix,
    const bool bPerformFrameStripping,
    const TArray< uint8 >& Data
)

Protected function

void

 

ApplyCompressedData

(
    const TArray< uint8 >& Data
)

Public function

void

 

BakeOutAdditiveIntoRawData

(
    TArray< FRawAnimSequenceTrack >& N...,
    TArray< FName >& NewAnimationTrack...,
    TArray< FTrackToSkeletonMap >& New...,
    FRawCurveTracks& NewCurveTracks,
    TArray< FRawAnimSequenceTrack >& A...
)

Bakes out the additive version of this animation into the raw data.

Public function

void

 

BakeOutVirtualBoneTracks

(
    TArray< FRawAnimSequenceTrack >& N...,
    TArray< FName >& NewAnimationTrack...,
    TArray< FTrackToSkeletonMap >& New...
)

Bakes out track data for the skeletons virtual bones into the raw data.

Public function

void

 

BakeTrackCurvesToRawAnimation()

Bake Transform Curves.TransformCurves to RawAnimation after making a back up of current RawAnimation

Public function Const

bool

 

CanBakeAdditive()

Is this animation valid for baking into additive.

Public function

void

 

CleanAnimSequenceForImport()

Clears some data in the AnimSequence, so it can be reused when importing a new animation with same name over it.

Public function

void

 

ClearBakedTransformData()

Sometimes baked data gets invalidated.

Public function

void

 

ClearCompressedBoneData()

Public function

void

 

ClearCompressedCurveData()

Public function

bool

 

CompressRawAnimData

(
    float MaxPosDiff,
    float MaxAngleDiff
)

Removes trivial frames frames of tracks when position or orientation is constant over the entire animation from the raw animation data.

Public function

bool

 

CompressRawAnimData()

Removes trivial frames frames of tracks when position or orientation is constant over the entire animation from the raw animation data.

Public function Static

bool

 

CopyNotifies

(
    UAnimSequence* SourceAnimSeq,
    UAnimSequence* DestAnimSeq,
    bool bShowDialogs
)

Copy AnimNotifies from one UAnimSequence to another.

Public function

bool

 

CreateAnimation

(
    UAnimSequence* Sequence
)

Create Animation Sequence from the given animation

Public function

bool

 

CreateAnimation

(
    USkeletalMesh* Mesh
)

Create Animation Sequence from Reference Pose of the Mesh

Public function

bool

 

CreateAnimation

(
    USkeletalMeshComponent* MeshCo...
)

Create Animation Sequence from the Mesh Component's current bone transform

Public function

bool

 

CropRawAnimData

(
    float CurrentTime,
    bool bFromStart
)

Crops the raw anim data either from Start to CurrentTime or CurrentTime to End depending on value of bFromStart.

Public function Const

bool

 

DoesContainTransformCurves()

Return true if it contains transform curves

Public function Const

bool

 

DoesNeedRebake()

Return true if it needs to re-bake

Public function Const

bool

 

DoesNeedRecompress()

Return true if compressed data is out of date / missing and so animation needs to use raw data

Public function

bool

 

DoesSequenceContainZeroScale()

Test whether at any point we will scale a bone to 0 (needed for validating additive anims)

Public function Const

void

 

ExtractBoneTransform

(
    const FRawAnimSequenceTrack& RawTr...,
    FTransform& OutAtom,
    int32 KeyIndex
)

Public function Const

void

 

ExtractBoneTransform

(
    const TArray< struct FRawAnimSequen...,
    FTransform& OutAtom,
    int32 TrackIndex,
    float Time
)

Extract Bone Transform of the Time given, from InRawAnimationData

Public function Const

void

 

ExtractBoneTransform

(
    const FRawAnimSequenceTrack& InRaw...,
    FTransform& OutAtom,
    float Time
)

Extract Bone Transform of the Time given, from InRawAnimationData

Public function Const

FTransform

 

ExtractRootMotion

(
    float StartTime,
    float DeltaTime,
    bool bAllowLooping
)

Extract Root Motion transform from the animation.

Public function Const

FTransform

 

ExtractRootMotionFromRange

(
    float StartTrackPosition,
    float EndTrackPosition
)

Extract Root Motion transform from a contiguous position range (no looping)

Public function Const

FTransform

 

ExtractRootTrackTransform

(
    float Pos,
    const FBoneContainer* Required...
)

Extract the transform from the root track for the given animation position.

Protected function

FCustomAttri...

 

FindOrAddCustomAttributeForBone

(
    const FName& BoneName
)

Public function

uint8 *

 

FindSyncMarkerPropertyData

(
    int32 SyncMarkerIndex,
    FArrayProperty*& ArrayProperty
)

Get a pointer to the data for a given Anim Notify.

Public function Const

void

 

FlagDependentAnimationsAsRawDataOnly()

Helper function to allow us to notify animations that depend on us that they need to update.

Public function

void

 

FlipRotationWForNonRoot

(
    USkeletalMesh* SkelMesh
)

Flip Rotation's W For NonRoot items, and compress it again if SkelMesh exists

Public function Const

FGuid

 

GenerateGuidFromRawData()

Generate a GUID from a hash of our own raw data.

Public function Const

const TArray...

 

GetAnimationTrackNames()

Public function Const

int32

 

GetApproxBoneCompressedSize()

Public function Const

int32

 

GetApproxCompressedSize()

Public function Const

int32

 

GetApproxRawSize()

Public function Const

void

 

GetBonePose

(
    FAnimationPoseData& OutAnimationPo...,
    const FAnimExtractContext& Extract...,
    bool bForceUseRawData
)

Get Bone Transform of the Time given, relative to Parent for all RequiredBones This returns different transform based on additive or not.

Public function Const

void

 

GetBoneTransform

(
    FTransform& OutAtom,
    int32 TrackIndex,
    FAnimSequenceDecompressionContext&...,
    bool bUseRawData
)

Get Bone Transform of the Time given, relative to Parent for the Track Given

Public function Const

void

 

GetBoneTransform

(
    FTransform& OutAtom,
    int32 TrackIndex,
    float Time,
    bool bUseRawData
)

Get Bone Transform of the Time given, relative to Parent for the Track Given

Public function Const

const TArray...

 

GetCompressedCurveNames()

Public function Const

const TArray...

 

GetCompressedTrackToSkeletonMapTable()

Public function Const

float

 

GetCurrentTimeFromMarkers

(
    FMarkerPair& PrevMarker,
    FMarkerPair& NextMarker,
    float PositionBetweenMarkers
)

Advancing based on markers.

Public function Const

void

 

GetCustomAttributes

(
    FAnimationPoseData& OutAnimationPo...,
    const FAnimExtractContext& Extract...,
    bool bUseRawData
)

Public function Const

void

 

GetCustomAttributesForBone

(
    const FName& BoneName,
    TArray< FCustomAttribute >& OutAtt...
)

Public function Const

FString

 

GetDDCCacheKeySuffix

(
    const bool bPerformStripping
)

Public function Const

float

 

GetFrameRate()

Returns the framerate of the animation.

Public function Const

const TArray...

 

GetRawAnimationData()

Public function Const

const FRawAn...

 

GetRawAnimationTrack

(
    int32 TrackIndex
)

Public function

FRawAnimSequ...

 

GetRawAnimationTrack

(
    int32 TrackIndex
)

Public function Const

FGuid

 

GetRawDataGuid()

Return this animations guid for the raw data.

Public function Const

int32

 

GetRawNumberOfFrames()

Accessors for animation frame count.

Public function Const

const TArray...

 

GetRawTrackToSkeletonMapTable()

Public function Const

int32

 

GetSkeletonIndexFromCompressedDataTrackIndex

(
    const int32 TrackIndex
)

Get Skeleton Bone Index from Track Index for compressed data

Public function Const

int32

 

GetSkeletonIndexFromRawDataTrackIndex

(
    const int32 TrackIndex
)

Begin Utility functions.

Public function Const

int32

 

GetUncompressedRawSize()

Public function Const

bool

 

HasBakedTransformCurves()

Returns whether this animation has baked transform curves (i.e. has the raw data been modified)

Public function Const

bool

 

HasSourceRawData()

Public function

bool

 

InsertFramesToRawAnimData

(
    int32 StartFrame,
    int32 EndFrame,
    int32 CopyFrame
)

Crops the raw anim data either from Start to CurrentTime or CurrentTime to End depending on value of bFromStart.

Public function Const

bool

 

IsCompressedDataValid()

Public function Const

bool

 

IsCurveCompressedDataValid()

Public function Const

bool

 

OnlyUseRawData()

Should we be always using our raw data (i.e is our compressed data stale)

Public function

void

 

OnRawDataChanged()

Kick off compression request when our raw data has changed.

Public function

void

 

PostProcessSequence

(
    bool bForceNewRawDatGuid
)

End Utility functions.

Public function

void

 

RecycleAnimSequence()

Clears any data in the AnimSequence

Public function

void

 

RefreshSyncMarkerDataFromAuthored()

Refresh sync marker data

Public function

void

 

RemoveAllCustomAttributes()

Public function

void

 

RemoveAllCustomAttributesForBone

(
    const FName& BoneName
)

Public function

void

 

RemoveAllTracks()

Clear all raw animation data that contains bone tracks

Public function

void

 

RemoveCustomAttribute

(
    const FName& BoneName,
    const FName& AttributeName
)

Public function

void

 

RequestAnimCompression

(
    FRequestAnimCompressionParams Param...
)

Public function

void

 

RequestAsyncAnimRecompression

(
    bool bOutput
)

Public function

void

 

RequestSyncAnimRecompression

(
    bool bOutput
)

Public function

void

 

ResizeSequence

(
    float NewLength,
    int32 NewNumFrames,
    bool bInsert,
    int32 StartFrame,
    int32 EndFrame
)

Utility function to resize the sequence It rearranges curve data + notifies

Public function

void

 

RestoreSourceData()

Restore the pre baked transform curve raw data

Public function

void

 

SerializeCompressedData

(
    FArchive& Ar,
    bool bDDCData
)

Write the compressed data to the supplied FArchive.

Public function

void

 

SetRawNumberOfFrame

(
    int32 InNumFrames
)

Public function

void

 

SetUseRawDataOnly

(
    bool bInUseRawDataOnly
)

Public function Const

bool

 

ShouldPerformStripping

(
    const bool bPerformFrameStripping,
    const bool bPerformStrippingOnOddFr...
)

Get compressed data for this UAnimSequence. May be built directly or pulled from DDC.

Public function

void

 

SortSyncMarkers()

Sort the sync markers array by time, earliest first.

Protected function

void

 

SynchronousCustomAttributesCompression()

Public function Const

void

 

TestEvalauteAnimation()

Performs multiple evaluations of the animation as a test of compressed data validatity.

Public function

void

 

UpdateCompressedCurveName

(
    SmartName::UID_Type CurveUID,
    const FSmartName& NewCurveName
)

Public function Const

void

 

UpdateDependentStreamingAnimations()

Helper function to allow us to update streaming animations that depend on us with our data when we are updated.

Public function Const

bool

 

UseRawDataForPoseExtraction

(
    const FBoneContainer& RequiredBone...
)

Public function Const

void

 

ValidateCurrentPosition

(
    const FMarkerSyncAnimPosition& Pos...,
    bool bPlayingForwards,
    bool bLooping,
    float& CurrentTime,
    FMarkerPair& PreviousMarker,
    FMarkerPair& NextMarker
)

Take a set of marker positions and validates them against a requested start position, updating them as desired

Public function

void

 

WaitOnExistingCompression

(
    const bool bWantResults
)

Overridden from UAnimSequenceBase

Name Description

Public function Virtual Const

void

 

AdvanceMarkerPhaseAsFollower

(
    const FMarkerTickContext& Context,
    float DeltaRemaining,
    bool bLooping,
    float& CurrentTime,
    FMarkerPair& PreviousMarker,
    FMarkerPair& NextMarker
)

Public function Virtual Const

void

 

AdvanceMarkerPhaseAsLeader

(
    bool bLooping,
    float MoveDelta,
    const TArray< FName >& ValidMarker...,
    float& CurrentTime,
    FMarkerPair& PrevMarker,
    FMarkerPair& NextMarker,
    TArray< FPassedMarker >& MarkersPa...
)

Public function Virtual

void

 

EnableRootMotionSettingFromMontage

(
    bool bInEnableRootMotion,
    const ERootMotionRootLock::Type InR...
)

To support anim sequence base to all montages

Public function Virtual Const

void

 

EvaluateCurveData

(
    FBlendedCurve& OutCurve,
    float CurrentTime,
    bool bForceUseRawData
)

Evaluate curve data to Instance at the time of CurrentTime

Public function Virtual Const

float

 

EvaluateCurveData

(
    SmartName::UID_Type CurveUID,
    float CurrentTime,
    bool bForceUseRawData
)

Evaluate curve data to Instance at the time of CurrentTime

Public function Virtual Const

EAdditiveAni...

 

GetAdditiveAnimType()

Default implementation, no additive

Public function Virtual Const

UAnimSequenc...

 

GetAdditiveBasePose()

Ideally this would be animsequcnebase, but we might have some issue with that. For now, just allow AnimSequence

Public function Virtual Const

void

 

GetAnimationPose

(
    FAnimationPoseData& OutAnimationPo...,
    const FAnimExtractContext& Extract...
)

Begin Transform related functions.

Public function Virtual Const

float

 

GetFirstMatchingPosFromMarkerSyncPos

(
    const FMarkerSyncAnimPosition& InM...
)

Public function Virtual Const

void

 

GetMarkerIndicesForPosition

(
    const FMarkerSyncAnimPosition& Syn...,
    bool bLooping,
    FMarkerPair& OutPrevMarker,
    FMarkerPair& OutNextMarker,
    float& CurrentTime
)

Public function Virtual Const

void

 

GetMarkerIndicesForTime

(
    float CurrentTime,
    bool bLooping,
    const TArray< FName >& ValidMarker...,
    FMarkerPair& OutPrevMarker,
    FMarkerPair& OutNextMarker
)

Public function Virtual Const

FMarkerSyncA...

 

GetMarkerSyncPositionfromMarkerIndicies

(
    int32 PrevMarker,
    int32 NextMarker,
    float CurrentTime
)

Public function Virtual Const

float

 

GetNextMatchingPosFromMarkerSyncPos

(
    const FMarkerSyncAnimPosition& InM...,
    const float& StartingPosition
)

Public function Virtual Const

int32

 

GetNumberOfFrames()

Return Number of Frames

Public function Virtual Const

float

 

GetPrevMatchingPosFromMarkerSyncPos

(
    const FMarkerSyncAnimPosition& InM...,
    const float& StartingPosition
)

Public function Virtual Const

void

 

HandleAssetPlayerTickedInternal

(
    FAnimAssetTickContext& Context,
    const float PreviousTime,
    const float MoveDelta,
    const FAnimTickRecord& Instance,
    FAnimNotifyQueue& NotifyQueue
)

Public function Virtual Const

bool

 

HasCurveData

(
    SmartName::UID_Type CurveUID,
    bool bForceUseRawData
)

Public function Virtual Const

bool

 

HasRootMotion()

Public function Virtual Const

bool

 

IsValidToPlay()

Add validation check to see if it's being ready to play or not

Public function Virtual

void

 

MarkRawDataAsModified

(
    bool bForceNewRawDatGuid
)

Store that our raw data has changed so that we can get correct compressed data later on.

Public function Virtual

void

 

RefreshCacheData()

Update cache data (notify tracks, sync markers)

Overridden from UAnimationAsset

Name Description

Public function Virtual

bool

 

GetAllAnimationSequencesReferred

(
    TArray< UAnimationAsset* >& A...,
    bool bRecursive
)

Retrieve all animations that are used by this asset

Public function Virtual Const

int32

 

GetMarkerUpdateCounter()

Public function Virtual

TArray< FNam...

 

GetUniqueMarkerNames()

Return a list of unique marker names for blending compatibility

Public function Virtual Const

bool

 

IsValidAdditive()

Return true if this is valid additive animation false otherwise

Public function Virtual

void

 

ReplaceReferredAnimations

(
    const TMap< UAnimationAsset*, ...
)

Replace this assets references to other animations based on ReplacementMap

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual Const

void

 

GetAssetRegistryTags

(
    TArray< FAssetRegistryTag >& OutTa...
)

Gathers a list of asset registry searchable tags which are name/value pairs with some type information This only needs to be implemented for asset objects

Public function Virtual

void

 

GetPreloadDependencies

(
    TArray< UObject* >& OutDeps
)

Called during cooking.

Public function Virtual

void

 

PostDuplicate

(
    bool bDuplicateForPIE
)

Called after duplication & serialization and before PostLoad.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

PreSave

(
    const ITargetPlatform* TargetP...
)

Presave function.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Deprecated Variables

Name Description

Public variable

FString

 

SourceFilePath_DEPRECATED

Path to the resource used to construct this skeletal mesh

Public variable

FString

 

SourceFileTimestamp_DEPRECATED

Date/Time-stamp of the file from the last import

Deprecated Functions

Name Description

Public function Const

void

 

GetAdditiveBasePose

(
    FAnimationPoseData& OutAnimationPo...,
    const FAnimExtractContext& Extract...
)

Use other GetAdditiveBasePose signature

Public function Const

void

 

GetAdditiveBasePose

(
    FCompactPose& OutPose,
    FBlendedCurve& OutCurve,
    const FAnimExtractContext& Extract...
)

Use other GetAdditiveBasePose signature

Public function Const

void

 

GetBonePose

(
    FCompactPose& OutPose,
    FBlendedCurve& OutCurve,
    const FAnimExtractContext& Extract...,
    bool bForceUseRawData
)

Use other GetBonePose signature

Public function Const

void

 

GetBonePose_Additive

(
    FCompactPose& OutPose,
    FBlendedCurve& OutCurve,
    const FAnimExtractContext& Extract...
)

Use other GetBonePose_Additive signature

Public function Const

void

 

GetBonePose_Additive

(
    FAnimationPoseData& OutAnimationPo...,
    const FAnimExtractContext& Extract...
)

Use other GetBonePose_Additive signature

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