UAnimCompress

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

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

Include

#include "Animation/AnimCompress.h"

Syntax

class UAnimCompress : public UAnimBoneCompressionCodec

Variables

Name Description

Public variable

uint32: 1

 

bNeedsSkeleton

Compression algorithms requiring a skeleton should set this value to true.

Public variable

TEnumAsByte< An...

 

RotationCompressionFormat

Format for bitwise compression of rotation data.

Public variable

TEnumAsByte< An...

 

ScaleCompressionFormat

Format for bitwise compression of scale data.

Public variable

TEnumAsByte< An...

 

TranslationCompressionFormat

Format for bitwise compression of translation data.

Constructors

Name Description

Public function

UAnimCompress

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Static

void

 

BitwiseCompressAnimationTracks

(
    const FCompressibleAnimData& Compr...,
    FCompressibleAnimDataResult& OutCo...,
    AnimationCompressionFormat TargetTr...,
    AnimationCompressionFormat TargetRo...,
    AnimationCompressionFormat TargetSc...,
    const TArray< FTranslationTrack >&...,
    const TArray< FRotationTrack >& Ro...,
    const TArray< FScaleTrack >& Scale...,
    bool IncludeKeyTable
)

Encodes individual key arrays into an AnimSequence using the desired bit packing formats.

Protected function Virtual

bool

 

DoReduction

(
    const FCompressibleAnimData& Compr...,
    FCompressibleAnimDataResult& OutRe...
)

Implemented by child classes, this function reduces the number of keyframes in the specified sequence, given the specified skeleton (if needed).

Protected function Static

void

 

FilterIntermittentKeys

(
    TArray< struct FTranslationTrack > ...,
    TArray< struct FRotationTrack >& R...,
    int32 StartIndex,
    int32 Interval
)

Common compression utility to retain only intermittent animation keys.

Protected function Static

void

 

FilterIntermittentPositionKeys

(
    FTranslationTrack& Track,
    int32 StartIndex,
    int32 Interval
)

Common compression utility to retain only intermittent position keys.

Protected function Static

void

 

FilterIntermittentPositionKeys

(
    TArray< struct FTranslationTrack > ...,
    int32 StartIndex,
    int32 Interval
)

Common compression utility to retain only intermittent position keys.

Protected function Static

void

 

FilterIntermittentRotationKeys

(
    FRotationTrack& Track,
    int32 StartIndex,
    int32 Interval
)

Common compression utility to retain only intermittent rotation keys.

Protected function Static

void

 

FilterIntermittentRotationKeys

(
    TArray< struct FRotationTrack >& R...,
    int32 StartIndex,
    int32 Interval
)

Common compression utility to retain only intermittent rotation keys.

Protected function Static

void

 

FilterTrivialKeys

(
    TArray< struct FTranslationTrack > ...,
    TArray< struct FRotationTrack >& R...,
    TArray< struct FScaleTrack >& Scal...,
    float MaxPosDelta,
    float MaxRotDelta,
    float MaxScaleDelta
)

Common compression utility to remove 'redundant' keys based on the provided delta thresholds

Protected function Static

void

 

FilterTrivialPositionKeys

(
    FTranslationTrack& Track,
    float MaxPosDelta
)

Common compression utility to remove 'redundant' position keys in a single track based on the provided delta threshold

Protected function Static

void

 

FilterTrivialPositionKeys

(
    TArray< struct FTranslationTrack > ...,
    float MaxPosDelta
)

Common compression utility to remove 'redundant' position keys based on the provided delta threshold

Protected function Static

void

 

FilterTrivialRotationKeys

(
    FRotationTrack& Track,
    float MaxRotDelta
)

Common compression utility to remove 'redundant' rotation keys in a set of tracks based on the provided delta threshold

Protected function Static

void

 

FilterTrivialRotationKeys

(
    TArray< struct FRotationTrack >& I...,
    float MaxRotDelta
)

Common compression utility to remove 'redundant' rotation keys in a set of tracks based on the provided delta threshold

Protected function Static

void

 

FilterTrivialScaleKeys

(
    TArray< struct FScaleTrack >& Trac...,
    float MaxScaleDelta
)

Common compression utility to remove 'redundant' Scale keys based on the provided delta threshold

Protected function Static

void

 

FilterTrivialScaleKeys

(
    FScaleTrack& Track,
    float MaxScaleDelta
)

Common compression utility to remove 'redundant' Scale keys in a single track based on the provided delta threshold

Protected function Static

void

 

PackQuaternionToStream

(
    TArray< uint8 >& ByteStream,
    AnimationCompressionFormat Format,
    const FQuat& Quat,
    const float* Mins,
    const float* Ranges
)

Utility function to append a packed FQuat to a byte stream.

Protected function Static

void

 

PackVectorToStream

(
    TArray< uint8 >& ByteStream,
    AnimationCompressionFormat Format,
    const FVector& Vec,
    const float* Mins,
    const float* Ranges
)

Utility function to append a packed FVector to a byte stream.

Protected function Static

void

 

PadByteStream

(
    TArray< uint8 >& ByteStream,
    const int32 Alignment,
    uint8 Sentinel
)

Pads a byte stream to force a particular alignment for the data to follow.

Public function

void

 

PopulateDDCKeyArchive

(
    FArchive& Ar
)

Protected function Static

void

 

PrecalculateShortestQuaternionRoutes

(
    TArray< struct FRotationTrack >& R...
)

Common compression utility to walk an array of rotation tracks and enforce that all adjacent rotation keys are represented by shortest-arc quaternion pairs.

Protected function Static

void

 

SeparateRawDataIntoTracks

(
    const TArray< struct FRawAnimSequen...,
    float SequenceLength,
    TArray< struct FTranslationTrack > ...,
    TArray< struct FRotationTrack >& O...,
    TArray< struct FScaleTrack >& OutS...
)

Common compression utility to populate individual rotation and translation track arrays from a set of raw animation tracks.

Protected function Static

void

 

UnalignedWriteToStream

(
    TArray< uint8 >& ByteStream,
    const void* Src,
    SIZE_T Len
)

Utility function to append data to a byte stream.

Protected function Static

void

 

UnalignedWriteToStream

(
    TArray< uint8 >& ByteStream,
    int32& StreamOffset,
    const void* Src,
    SIZE_T Len
)

Utility function to write data to a byte stream.

Overridden from UAnimBoneCompressionCodec

Name Description

Public function Virtual Const

TUniquePtr< ...

 

AllocateAnimData()

Allocates the necessary anim data structure used for decompression.

Public function Virtual Const

void

 

ByteSwapIn

(
    ICompressedAnimData& AnimData,
    TArrayView< uint8 > CompressedData,
    FMemoryReader& MemoryStream
)

Handles Byte-swapping incoming animation data from a MemoryReader

Public function Virtual Const

void

 

ByteSwapOut

(
    ICompressedAnimData& AnimData,
    TArrayView< uint8 > CompressedData,
    FMemoryWriter& MemoryStream
)

Handles Byte-swapping outgoing animation data to an array of BYTEs

Public function Virtual

bool

 

Compress

(
    const FCompressibleAnimData& Compr...,
    FCompressibleAnimDataResult& OutRe...
)

UAnimBoneCompressionCodec implementation

Public function Virtual Const

void

 

DecompressBone

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

Decompress a single bone.

Public function Virtual Const

void

 

DecompressPose

(
    FAnimSequenceDecompressionContext&...,
    const BoneTrackArray& RotationPair...,
    const BoneTrackArray& TranslationP...,
    const BoneTrackArray& ScalePairs,
    TArrayView< FTransform >& OutAtoms
)

Decompresses all the specified bone tracks.

Protected function Virtual

void

 

PopulateDDCKey

(
    FArchive& Ar
)

Called to generate a unique DDC key for this codec instance.

Constants

Name

Description

AnimationPadSentinel

Default animation padding value.

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