UAnimCompress_RemoveLinearKeys

Keyframe reduction algorithm that simply removes keys which are linear interpolations of surrounding keys.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

Engine

Header

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

Include

#include "Animation/AnimCompress_RemoveLinearKeys.h"

Syntax

class UAnimCompress_RemoveLinearKeys : public UAnimCompress

Remarks

Keyframe reduction algorithm that simply removes keys which are linear interpolations of surrounding keys.

Variables

Name Description

Public variable

uint32: 1

 

bActuallyFilterLinearKeys

Controls whether the final filtering step will occur, or only the retargetting after bitwise compression.

Public variable

uint32: 1

 

bRetarget

True = As the animation is compressed, adjust animated nodes to compensate for compression error.

Public variable

float

 

EffectorDiffSocket

Error threshold for End Effectors with Sockets attached to them.

Public variable

float

 

MaxAngleDiff

Maximum angle difference to use when testing if an animation key may be removed.

Public variable

float

 

MaxEffectorDiff

As keys are tested for removal, we monitor the effects all the way down to the end effectors.

Public variable

float

 

MaxPosDiff

Maximum position difference to use when testing if an animation key may be removed.

Public variable

float

 

MaxScaleDiff

Maximum Scale difference to use when testing if an animation key may be removed.

Public variable

float

 

MinEffectorDiff

As keys are tested for removal, we monitor the effects all the way down to the end effectors.

Public variable

float

 

ParentKeyScale

A scale value which increases the likelihood that a bone will retain a key if it's parent also had a key at the same time position.

Constructors

Name Description

Public function

UAnimCompress_RemoveLinearKeys

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Protected function Virtual

void

 

CompressUsingUnderlyingCompressor

(
    const FCompressibleAnimData& Compr...,
    FCompressibleAnimDataResult& OutCo...,
    const TArray< FTranslationTrack >&...,
    const TArray< FRotationTrack >& Ro...,
    const TArray< FScaleTrack >& Scale...,
    const bool bFinalPass
)

Compresses the tracks passed in using the underlying compressor for this key removal codec

Protected function

void

 

ConvertFromRelativeSpace

(
    FCompressibleAnimData& Compressibl...
)

If the passed in animation sequence is additive, converts it to absolute (using the frame 0 pose) and returns true (indicating it should be converted back to relative later with ConvertToRelativeSpace)

Protected function Const

void

 

ConvertToRelativeSpace

(
    FCompressibleAnimData& Compressibl...
)

Converts an absolute animation sequence to a relative (additive) one.

Protected function Const

void

 

ConvertToRelativeSpace

(
    const FCompressibleAnimData& Compr...,
    TArray< FTranslationTrack >& Trans...,
    TArray< FRotationTrack >& Rotation...,
    TArray< FScaleTrack >& ScaleData
)

Converts track data to relative (additive) space.

Protected function

void

 

ConvertToRelativeSpaceBoth

(
    FCompressibleAnimData& Compressibl...,
    TArray< FTranslationTrack >& Trans...,
    TArray< FRotationTrack >& Rotation...,
    TArray< FScaleTrack >& ScaleData
)

Converts an absolute animation sequence and matching track data to a relative (additive) one.

Protected function Virtual

void *

 

FilterBeforeMainKeyRemoval

(
    const FCompressibleAnimData& Compr...,
    TArray< FTranslationTrack >& Trans...,
    TArray< FRotationTrack >& Rotation...,
    TArray< FScaleTrack >& ScaleData
)

Pre-filters the tracks before running the main key removal algorithm

Protected function

void

 

ProcessAnimationTracks

(
    const FCompressibleAnimData& Compr...,
    FCompressibleAnimDataResult& OutCo...,
    TArray< FTranslationTrack >& Posit...,
    TArray< FRotationTrack >& Rotation...,
    TArray< FScaleTrack >& ScaleTracks
)

Locates spans of keys within the position and rotation tracks provided which can be estimated through linear interpolation of the surrounding keys.

Protected function Static

void

 

UpdateBoneAtomList

(
    const FCompressibleAnimData& Compr...,
    FCompressibleAnimDataResult& OutCo...,
    int32 BoneIndex,
    int32 TrackIndex,
    int32 NumFrames,
    float TimePerFrame,
    TArray< FTransform >& BoneAtoms
)

Creates a list of the bone atom result for every frame of a given track

Protected function

void

 

UpdateWorldBoneTransformRange

(
    const FCompressibleAnimData& Compr...,
    FCompressibleAnimDataResult& OutCo...,
    const TArray< FTransform >& RefPos...,
    const TArray< FTranslationTrack >&...,
    const TArray< FRotationTrack >& Ro...,
    const TArray< FScaleTrack >& Scale...,
    int32 StartingBoneIndex,
    int32 EndingBoneIndex,
    bool UseRaw,
    TArray< FTransform >& OutputWorldB...
)

Updates the world bone transforms for a range of bone indices

Protected function

void

 

UpdateWorldBoneTransformTable

(
    const FCompressibleAnimData& Compr...,
    FCompressibleAnimDataResult& OutCo...,
    const TArray< FTransform >& RefPos...,
    int32 BoneIndex,
    bool UseRaw,
    TArray< FTransform >& OutputWorldB...
)

To guide the key removal process, we need to maintain a table of world transforms for the bones we are investigating.

Overridden from UAnimCompress

Name Description

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

Overridden from UAnimBoneCompressionCodec

Name Description

Protected function Virtual

void

 

PopulateDDCKey

(
    FArchive& Ar
)

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