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

#include <AnimLinkableElement.h>

+ Inheritance diagram for FAnimLinkableElement:

Public Member Functions

 FAnimLinkableElement ()
 
virtual ~FAnimLinkableElement ()
 
ENGINE_API void Update ()
 
ENGINE_API void Link (UAnimSequenceBase *AnimSequenceBase, float AbsTime, int32 InSlotIndex=0)
 
ENGINE_API void LinkMontage (UAnimMontage *Montage, float AbsMontageTime, int32 InSlotIndex=0)
 
ENGINE_API void LinkSequence (UAnimSequenceBase *Sequence, float AbsSequenceTime)
 
ENGINE_API void Clear ()
 
ENGINE_API void OnChanged (float NewMontageTime)
 
ENGINE_API float GetTime (EAnimLinkMethod::Type ReferenceFrame=EAnimLinkMethod::Absolute) const
 
virtual ENGINE_API void SetTime (float NewTime, EAnimLinkMethod::Type ReferenceFrame=EAnimLinkMethod::Absolute)
 
const UAnimSequenceBaseGetLinkedSequence () const
 
const UAnimMontageGetLinkedMontage () const
 
ENGINE_API void ChangeLinkMethod (EAnimLinkMethod::Type NewLinkMethod)
 
ENGINE_API void ChangeSlotIndex (int32 NewSlotIndex)
 
EAnimLinkMethod::Type GetLinkMethod () const
 
int32 GetSlotIndex () const
 
int32 GetSegmentIndex () const
 
void SetSegmentIndex (int32 NewSegmentIndex)
 
ENGINE_API bool ConditionalRelink ()
 
ENGINE_API void RefreshSegmentOnLoad ()
 

Protected Member Functions

FAnimSegmentGetSegmentAtCurrentTime ()
 

Protected Attributes

TObjectPtr< UAnimMontageLinkedMontage
 
int32 SlotIndex
 
int32 SegmentIndex
 
TEnumAsByte< EAnimLinkMethod::TypeLinkMethod
 
TEnumAsByte< EAnimLinkMethod::TypeCachedLinkMethod
 
float SegmentBeginTime
 
float SegmentLength
 
float LinkValue
 
TObjectPtr< UAnimSequenceBaseLinkedSequence
 

Detailed Description

Used to describe an element that can be linked to a segment in a montage or sequence. Usage: Inherit from FAnimLinkableElement and make sure to call LinkMontage or LinkSequence both on creation and on loading the element. From there SetTime and GetTime should be used to control where this element is in the montage or sequence.

For more advanced usage, see this implementation used in FAnimNotifyEvent where we have a secondary link to handle a duration

See also
FAnimNotifyEvent

Constructor & Destructor Documentation

◆ FAnimLinkableElement()

FAnimLinkableElement::FAnimLinkableElement ( )
inline

◆ ~FAnimLinkableElement()

virtual FAnimLinkableElement::~FAnimLinkableElement ( )
inlinevirtual

Member Function Documentation

◆ ChangeLinkMethod()

void FAnimLinkableElement::ChangeLinkMethod ( EAnimLinkMethod::Type  NewLinkMethod)

Changes the way this element is linked to its segment

Parameters
NewLinkMethodThe new linking method to use

◆ ChangeSlotIndex()

void FAnimLinkableElement::ChangeSlotIndex ( int32  NewSlotIndex)

Change the montage slot that this element is linked to

Parameters
NewSlotIndexThe new slot to link to

◆ Clear()

void FAnimLinkableElement::Clear ( )

Clear the linking information from this element, leaves montage link intact

◆ ConditionalRelink()

bool FAnimLinkableElement::ConditionalRelink ( )

Relinks this element if internal state requires relinking

◆ GetLinkedMontage()

const UAnimMontage * FAnimLinkableElement::GetLinkedMontage ( ) const
inline

Gets the Montage this element is linked to, if any

◆ GetLinkedSequence()

const UAnimSequenceBase * FAnimLinkableElement::GetLinkedSequence ( ) const
inline

Gets the sequence this element is linked to

◆ GetLinkMethod()

EAnimLinkMethod::Type FAnimLinkableElement::GetLinkMethod ( ) const
inline

Get the method used to link this element to its segment

◆ GetSegmentAtCurrentTime()

FAnimSegment * FAnimLinkableElement::GetSegmentAtCurrentTime ( )
protected

Gets the segment in the current montage in the current slot that is at the time of this element

◆ GetSegmentIndex()

int32 FAnimLinkableElement::GetSegmentIndex ( ) const
inline

Get the index of the segment this element is currently linked to

◆ GetSlotIndex()

int32 FAnimLinkableElement::GetSlotIndex ( ) const
inline

Get the slot index this element is currently linked to

◆ GetTime()

float FAnimLinkableElement::GetTime ( EAnimLinkMethod::Type  ReferenceFrame = EAnimLinkMethod::Absolute) const

Gets the current time for this element

Parameters
ReferenceFrameWhat kind of time to return

◆ Link()

void FAnimLinkableElement::Link ( UAnimSequenceBase AnimSequenceBase,
float  AbsTime,
int32  InSlotIndex = 0 
)

Link this element to an animation object (Sequence or Montage)

Parameters
AnimSequenceBaseThe object to link to
AbsTimeThe absolute time to place this element
InSlotIndexSlot index for montages (ignored otherwise)

◆ LinkMontage()

void FAnimLinkableElement::LinkMontage ( UAnimMontage Montage,
float  AbsMontageTime,
int32  InSlotIndex = 0 
)

Link this element to a montage

Parameters
MontageThe montage to link to
AbsMontageTimeThe time in the montage that this element should be placed at
InSlotIndexThe slot in the montage to detect segments in

◆ LinkSequence()

void FAnimLinkableElement::LinkSequence ( UAnimSequenceBase Sequence,
float  AbsSequenceTime 
)

Link this element to a Sequence, Just setting basic data as sequences don't need full linking

Parameters
SequenceThe sequence to link to
AbsSequenceTimeThe time in the sequence that this element should be placed at

◆ OnChanged()

void FAnimLinkableElement::OnChanged ( float  NewMontageTime)

Called when the properties of this element are changed

◆ RefreshSegmentOnLoad()

void FAnimLinkableElement::RefreshSegmentOnLoad ( )

Refreshes the current segment data (Begin time, length etc.) and validate the link time Intended to update the internal state when segment lengths/times could have changed

◆ SetSegmentIndex()

void FAnimLinkableElement::SetSegmentIndex ( int32  NewSegmentIndex)
inline

Directly sets segment index

Parameters
NewSegmentIndexNew segment index

◆ SetTime()

void FAnimLinkableElement::SetTime ( float  NewTime,
EAnimLinkMethod::Type  ReferenceFrame = EAnimLinkMethod::Absolute 
)
virtual

Sets the time of this element

Parameters
NewTimeThe time to set this element to
ReferenceFrameThe kind of time being passed to this method

Reimplemented in FAnimNotifyEvent.

◆ Update()

void FAnimLinkableElement::Update ( )

Update the timing information for this element. Will not search for a new segment unless this element does not have one

Member Data Documentation

◆ CachedLinkMethod

TEnumAsByte<EAnimLinkMethod::Type> FAnimLinkableElement::CachedLinkMethod
protected

Cached link method used to transform the time when LinkMethod changes, always relates to the currently stored time

◆ LinkedMontage

TObjectPtr<UAnimMontage> FAnimLinkableElement::LinkedMontage
protected

The montage that this element is currently linked to

◆ LinkedSequence

TObjectPtr<UAnimSequenceBase> FAnimLinkableElement::LinkedSequence
protected

The Animation Sequence that this montage element will link to, when the sequence changes in either length or rate; the element will correctly place itself in relation to the sequence

◆ LinkMethod

TEnumAsByte<EAnimLinkMethod::Type> FAnimLinkableElement::LinkMethod
protected

The method we are using to calculate our times

◆ LinkValue

float FAnimLinkableElement::LinkValue
protected

The time of this montage. This will differ depending upon the method we are using to link the time for this element

◆ SegmentBeginTime

float FAnimLinkableElement::SegmentBeginTime
protected

The absolute time in the montage that our currently linked segment begins

◆ SegmentIndex

int32 FAnimLinkableElement::SegmentIndex
protected

The index of the segment we are linked to within the slot we are using

◆ SegmentLength

float FAnimLinkableElement::SegmentLength
protected

The absolute length of our currently linked segment

◆ SlotIndex

int32 FAnimLinkableElement::SlotIndex
protected

The slot index we are currently using within LinkedMontage


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