UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FAttributeCurve Struct Reference

#include <AttributeCurve.h>

+ Inheritance diagram for FAttributeCurve:

Public Member Functions

 FAttributeCurve ()
 
 FAttributeCurve (UScriptStruct *InScriptStruct)
 
ENGINE_API FAttributeCurve (const FAttributeCurve &OtherCurve)
 
virtual ~FAttributeCurve ()
 
ENGINE_API bool Serialize (FArchive &Ar)
 
virtual int32 GetNumKeys () const override final
 
virtual FAttributeCurveDuplicate () const final
 
virtual ENGINE_API void SetKeyTime (FKeyHandle KeyHandle, float NewTime) override final
 
virtual ENGINE_API float GetKeyTime (FKeyHandle KeyHandle) const override final
 
ENGINE_API void SetScriptStruct (UScriptStruct *InScriptStruct)
 
const UScriptStructGetScriptStruct () const
 
ENGINE_API bool CanEvaluate () const
 
template<typename AttributeType >
AttributeType Evaluate (float Time) const
 
ENGINE_API bool HasAnyData () const
 
ENGINE_API void Reset ()
 
ENGINE_API TArray< FAttributeKey >::TConstIterator GetKeyIterator () const
 
template<typename AttributeType >
FKeyHandle AddTypedKey (float InTime, const AttributeType &InValue, FKeyHandle InKeyHandle=FKeyHandle())
 
ENGINE_API void DeleteKey (FKeyHandle KeyHandle)
 
template<typename AttributeType >
FKeyHandle UpdateOrAddTypedKey (float InTime, const AttributeType &InValue, float KeyTimeTolerance=UE_KINDA_SMALL_NUMBER)
 
FKeyHandle UpdateOrAddTypedKey (float InTime, const void *InValue, const UScriptStruct *ValueType, float KeyTimeTolerance=UE_KINDA_SMALL_NUMBER)
 
ENGINE_API FAttributeKeyGetKey (FKeyHandle KeyHandle)
 
ENGINE_API const FAttributeKeyGetKey (FKeyHandle KeyHandle) const
 
ENGINE_API FKeyHandle FindKey (float KeyTime, float KeyTimeTolerance=UE_KINDA_SMALL_NUMBER) const
 
ENGINE_API FKeyHandle FindKeyBeforeOrAt (float KeyTime) const
 
ENGINE_API void RemoveRedundantKeys ()
 
ENGINE_API void SetKeys (TArrayView< const float > InTimes, TArrayView< const void * > InValues)
 
template<typename AttributeType >
void GetTypedKeys (TArray< const AttributeType * > &OutKeys) const
 
ENGINE_API TArray< FAttributeKeyGetCopyOfKeys () const
 
ENGINE_API const TArray< FAttributeKey > & GetConstRefOfKeys () const
 
ENGINE_API void ReadjustTimeRange (float NewMinTimeRange, float NewMaxTimeRange, bool bInsert, float OldStartTime, float OldEndTime)
 
- Public Member Functions inherited from FIndexedCurve
 FIndexedCurve ()
 
virtual ~FIndexedCurve ()
 
ENGINE_API int32 GetIndexSafe (FKeyHandle KeyHandle) const
 
TArray< FKeyHandle >::TConstIterator GetKeyHandleIterator () const
 
ENGINE_API bool IsKeyHandleValid (FKeyHandle KeyHandle) const
 
FKeyHandle GetFirstKeyHandle () const
 
FKeyHandle GetLastKeyHandle () const
 
ENGINE_API FKeyHandle GetNextKey (FKeyHandle KeyHandle) const
 
ENGINE_API FKeyHandle GetPreviousKey (FKeyHandle KeyHandle) const
 
ENGINE_API void ShiftCurve (float DeltaTime)
 
ENGINE_API void ShiftCurve (float DeltaTime, const TSet< FKeyHandle > &KeyHandles)
 
ENGINE_API void ScaleCurve (float ScaleOrigin, float ScaleFactor)
 
ENGINE_API void ScaleCurve (float ScaleOrigin, float ScaleFactor, const TSet< FKeyHandle > &KeyHandles)
 

Protected Member Functions

ENGINE_API void EvaluateToPtr (const UScriptStruct *InScriptStruct, float Time, uint8 *InOutDataPtr) const
 
ENGINE_API FKeyHandle UpdateOrAddKey (float InTime, const void *InValue, float KeyTimeTolerance=UE_KINDA_SMALL_NUMBER)
 
ENGINE_API FKeyHandle AddKey (float InTime, const void *InValue, FKeyHandle InKeyHandle=FKeyHandle())
 
- Protected Member Functions inherited from FIndexedCurve
void EnsureAllIndicesHaveHandles () const
 
void EnsureIndexHasAHandle (int32 KeyIndex) const
 
const int32FindIndex (FKeyHandle KeyHandle) const
 
ENGINE_API int32 GetIndex (FKeyHandle KeyHandle) const
 
ENGINE_API FKeyHandle GetKeyHandle (int32 KeyIndex) const
 

Protected Attributes

TArray< FAttributeKeyKeys
 
FSoftObjectPath ScriptStructPath
 
TObjectPtr< UScriptStructScriptStruct
 
bool bShouldInterpolate
 
const UE::Anim::IAttributeBlendOperatorOperator
 
- Protected Attributes inherited from FIndexedCurve
FKeyHandleMap KeyHandlesToIndices
 

Friends

class UAnimSequence
 
struct UE::Anim::Attributes
 

Additional Inherited Members

- Public Attributes inherited from FIndexedCurve
virtual int32 GetNumKeys () const PURE_VIRTUAL(FIndexedCurve
 
virtual void virtual SetKeyTime(FKeyHandle KeyHandle, float NewTime) PURE_VIRTUAL(FIndexedCurve float GetKeyTime (FKeyHandle KeyHandle) const PURE_VIRTUAL(FIndexedCurve
 
virtual FIndexedCurveDuplicate () const PURE_VIRTUAL(FIndexedCurve
 

Constructor & Destructor Documentation

◆ FAttributeCurve() [1/3]

FAttributeCurve::FAttributeCurve ( )
inline

◆ FAttributeCurve() [2/3]

FAttributeCurve::FAttributeCurve ( UScriptStruct InScriptStruct)
inline

◆ FAttributeCurve() [3/3]

FAttributeCurve::FAttributeCurve ( const FAttributeCurve OtherCurve)

◆ ~FAttributeCurve()

virtual FAttributeCurve::~FAttributeCurve ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ AddKey()

FKeyHandle FAttributeCurve::AddKey ( float  InTime,
const void InValue,
FKeyHandle  InKeyHandle = FKeyHandle() 
)
protected

Add a new raw memory key (should be appropriately sized) to the curve with the supplied Time and Value.

◆ AddTypedKey()

template<typename AttributeType >
FKeyHandle FAttributeCurve::AddTypedKey ( float  InTime,
const AttributeType &  InValue,
FKeyHandle  InKeyHandle = FKeyHandle() 
)
inline

Add a new typed key to the curve with the supplied Time and Value.

◆ CanEvaluate()

bool FAttributeCurve::CanEvaluate ( ) const

Whether or not the curve can be evaluated, based upon having a valid type and any keys

◆ DeleteKey()

void FAttributeCurve::DeleteKey ( FKeyHandle  KeyHandle)

Remove the specified key from the curve.

◆ Duplicate()

virtual FAttributeCurve * FAttributeCurve::Duplicate ( ) const
inlinefinalvirtual

◆ Evaluate()

template<typename AttributeType >
AttributeType FAttributeCurve::Evaluate ( float  Time) const
inline

Evaluate the curve keys into a temporary value container

◆ EvaluateToPtr()

void FAttributeCurve::EvaluateToPtr ( const UScriptStruct InScriptStruct,
float  Time,
uint8 InOutDataPtr 
) const
protected

Evaluate the curve keys into the provided memory (should be appropriatedly sized)

◆ FindKey()

FKeyHandle FAttributeCurve::FindKey ( float  KeyTime,
float  KeyTimeTolerance = UE_KINDA_SMALL_NUMBER 
) const

Finds the key at KeyTime and returns its handle. If it can't find the key within the KeyTimeTolerance, it will return an invalid handle

◆ FindKeyBeforeOrAt()

FKeyHandle FAttributeCurve::FindKeyBeforeOrAt ( float  KeyTime) const

Gets the handle for the last key which is at or before the time requested. If there are no keys at or before the requested time, an invalid handle is returned.

◆ GetConstRefOfKeys()

const TArray< FAttributeKey > & FAttributeCurve::GetConstRefOfKeys ( ) const

◆ GetCopyOfKeys()

TArray< FAttributeKey > FAttributeCurve::GetCopyOfKeys ( ) const

Return copy of contained key-data

◆ GetKey() [1/2]

FAttributeKey & FAttributeCurve::GetKey ( FKeyHandle  KeyHandle)

Functions for getting keys based on handles

◆ GetKey() [2/2]

const FAttributeKey & FAttributeCurve::GetKey ( FKeyHandle  KeyHandle) const

◆ GetKeyIterator()

TArray< FAttributeKey >::TConstIterator FAttributeCurve::GetKeyIterator ( ) const

Const iterator for the keys, so the indices and handles stay valid

◆ GetKeyTime()

float FAttributeCurve::GetKeyTime ( FKeyHandle  KeyHandle) const
finaloverridevirtual

◆ GetNumKeys()

virtual int32 FAttributeCurve::GetNumKeys ( ) const
inlinefinaloverridevirtual

Begin FIndexedCurve overrides

◆ GetScriptStruct()

const UScriptStruct * FAttributeCurve::GetScriptStruct ( ) const
inline

◆ GetTypedKeys()

template<typename AttributeType >
void FAttributeCurve::GetTypedKeys ( TArray< const AttributeType * > &  OutKeys) const
inline

Populates OutKeys with typed value-ptrs

◆ HasAnyData()

bool FAttributeCurve::HasAnyData ( ) const

Check whether this curve has any data or not

◆ ReadjustTimeRange()

void FAttributeCurve::ReadjustTimeRange ( float  NewMinTimeRange,
float  NewMaxTimeRange,
bool  bInsert,
float  OldStartTime,
float  OldEndTime 
)

Used for adjusting the internal key-data when owning object its playlength changes

◆ RemoveRedundantKeys()

void FAttributeCurve::RemoveRedundantKeys ( )

Tries to reduce the number of keys required for accurate evaluation (zero error threshold)

◆ Reset()

void FAttributeCurve::Reset ( )

Removes all key data

◆ Serialize()

bool FAttributeCurve::Serialize ( FArchive Ar)

◆ SetKeys()

void FAttributeCurve::SetKeys ( TArrayView< const float InTimes,
TArrayView< const void * >  InValues 
)

◆ SetKeyTime()

void FAttributeCurve::SetKeyTime ( FKeyHandle  KeyHandle,
float  NewTime 
)
finaloverridevirtual

◆ SetScriptStruct()

void FAttributeCurve::SetScriptStruct ( UScriptStruct InScriptStruct)

End FIndexedCurve overrides Sets the underlying type for the curve, only possible when not containing any keys (see Reset)

◆ UpdateOrAddKey()

FKeyHandle FAttributeCurve::UpdateOrAddKey ( float  InTime,
const void InValue,
float  KeyTimeTolerance = UE_KINDA_SMALL_NUMBER 
)
protected

Finds the key at InTime, and updates its typed value. If it can't find the key within the KeyTimeTolerance, it adds one at that time

◆ UpdateOrAddTypedKey() [1/2]

template<typename AttributeType >
FKeyHandle FAttributeCurve::UpdateOrAddTypedKey ( float  InTime,
const AttributeType &  InValue,
float  KeyTimeTolerance = UE_KINDA_SMALL_NUMBER 
)
inline

Finds the key at InTime, and updates its typed value. If it can't find the key within the KeyTimeTolerance, it adds one at that time

◆ UpdateOrAddTypedKey() [2/2]

FKeyHandle FAttributeCurve::UpdateOrAddTypedKey ( float  InTime,
const void InValue,
const UScriptStruct ValueType,
float  KeyTimeTolerance = UE_KINDA_SMALL_NUMBER 
)
inline

Finds the key at InTime, and updates its typed value. If it can't find the key within the KeyTimeTolerance, it adds one at that time

Friends And Related Symbol Documentation

◆ UAnimSequence

friend class UAnimSequence
friend

◆ UE::Anim::Attributes

Member Data Documentation

◆ bShouldInterpolate

bool FAttributeCurve::bShouldInterpolate
protected

Whether or not to interpolate between keys of ScripStruct type

◆ Keys

TArray<FAttributeKey> FAttributeCurve::Keys
protected

The keys, ordered by time

◆ Operator

const UE::Anim::IAttributeBlendOperator* FAttributeCurve::Operator
protected

Operator instanced used for interpolating between keys

◆ ScriptStruct

TObjectPtr<UScriptStruct> FAttributeCurve::ScriptStruct
protected

◆ ScriptStructPath

FSoftObjectPath FAttributeCurve::ScriptStructPath
protected

The documentation for this struct was generated from the following files: