UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::MovieScene::FPreAnimatedStateExtension Struct Reference

#include <MovieScenePreAnimatedStateExtension.h>

Public Member Functions

MOVIESCENE_API FPreAnimatedStateExtension ()
 
MOVIESCENE_API ~FPreAnimatedStateExtension ()
 
MOVIESCENE_API void Initialize (UMovieSceneEntitySystemLinker *InLinker)
 
template<typename StorageType >
TSharedPtr< StorageType > FindStorage (TPreAnimatedStorageID< StorageType > InStorageID) const
 
template<typename StorageType >
void AddStorage (TPreAnimatedStorageID< StorageType > InStorageID, TSharedPtr< StorageType > InStorage)
 
template<typename StorageType >
TSharedPtr< StorageType > GetOrCreateStorage ()
 
template<typename StorageType >
TSharedPtr< StorageType > GetOrCreateStorage (TPreAnimatedStorageID< StorageType > InStorageID)
 
TSharedPtr< IPreAnimatedStorageGetStorageChecked (FPreAnimatedStorageID InStorageID) const
 
template<typename GroupManagerType >
TSharedPtr< GroupManagerTypeFindGroupManager () const
 
template<typename GroupManagerType >
TSharedPtr< GroupManagerTypeGetOrCreateGroupManager ()
 
MOVIESCENE_API FPreAnimatedStorageGroupHandle AllocateGroup (TSharedPtr< IPreAnimatedStateGroupManager > GroupManager)
 
MOVIESCENE_API void FreeGroup (FPreAnimatedStorageGroupHandle Index)
 
bool IsCapturingGlobalState () const
 
bool AreEntriesInvalidated () const
 
void ResetEntryInvalidation ()
 
MOVIESCENE_API void RestoreGlobalState (const FRestoreStateParams &Params)
 
MOVIESCENE_API void DiscardGlobalState (const FRestoreStateParams &Params)
 
MOVIESCENE_API void RestoreStateForGroup (FPreAnimatedStorageGroupHandle GroupHandle, const FRestoreStateParams &Params)
 
void DiscardStaleObjectState ()
 
MOVIESCENE_API void ReplaceObjectForGroup (FPreAnimatedStorageGroupHandle GroupHandle, const FObjectKey &OldObject, const FObjectKey &NewObject)
 
MOVIESCENE_API void DiscardTransientState ()
 
MOVIESCENE_API void DiscardStateForGroup (FPreAnimatedStorageGroupHandle GroupHandle)
 
MOVIESCENE_API void DiscardStateForStorage (FPreAnimatedStorageID StorageID, FPreAnimatedStorageIndex StorageIndex)
 
MOVIESCENE_API bool ContainsAnyStateForInstanceHandle (FRootInstanceHandle RootInstanceHandle) const
 
MOVIESCENE_API void SavePreAnimatedState (FMovieSceneAnimTypeID InTokenType, const IMovieScenePreAnimatedGlobalTokenProducer &Producer)
 
MOVIESCENE_API void SavePreAnimatedState (UObject &InObject, FMovieSceneAnimTypeID InTokenType, const IMovieScenePreAnimatedTokenProducer &Producer)
 
MOVIESCENE_API void SavePreAnimatedStateDirectly (FMovieSceneAnimTypeID InTokenType, const IMovieScenePreAnimatedGlobalTokenProducer &Producer)
 
MOVIESCENE_API void SavePreAnimatedStateDirectly (UObject &InObject, FMovieSceneAnimTypeID InTokenType, const IMovieScenePreAnimatedTokenProducer &Producer)
 
MOVIESCENE_API FPreAnimatedEntityCaptureSourceGetEntityMetaData () const
 
MOVIESCENE_API FPreAnimatedEntityCaptureSourceGetOrCreateEntityMetaData ()
 
MOVIESCENE_API FPreAnimatedTrackInstanceCaptureSourcesGetTrackInstanceMetaData () const
 
MOVIESCENE_API FPreAnimatedTrackInstanceCaptureSourcesGetOrCreateTrackInstanceMetaData ()
 
MOVIESCENE_API FPreAnimatedTrackInstanceInputCaptureSourcesGetTrackInstanceInputMetaData () const
 
MOVIESCENE_API FPreAnimatedTrackInstanceInputCaptureSourcesGetOrCreateTrackInstanceInputMetaData ()
 
MOVIESCENE_API FPreAnimatedTemplateCaptureSourcesGetTemplateMetaData () const
 
MOVIESCENE_API FPreAnimatedTemplateCaptureSourcesGetOrCreateTemplateMetaData ()
 
MOVIESCENE_API FPreAnimatedEvaluationHookCaptureSourcesGetEvaluationHookMetaData () const
 
MOVIESCENE_API FPreAnimatedEvaluationHookCaptureSourcesGetOrCreateEvaluationHookMetaData ()
 
MOVIESCENE_API bool HasActiveCaptureSource () const
 
MOVIESCENE_API void AddWeakCaptureSource (TWeakPtr< IPreAnimatedCaptureSource > InWeakMetaData)
 
MOVIESCENE_API void RemoveWeakCaptureSource (TWeakPtr< IPreAnimatedCaptureSource > InWeakMetaData)
 
MOVIESCENE_API void EnsureMetaData (const FPreAnimatedStateEntry &Entry)
 
MOVIESCENE_API void AddSourceMetaData (const FPreAnimatedStateEntry &Entry)
 
MOVIESCENE_API bool MetaDataExists (const FPreAnimatedStateEntry &Entry) const
 
MOVIESCENE_API void AddMetaData (const FPreAnimatedStateMetaData &MetaData)
 
MOVIESCENE_API void RemoveMetaData (const FPreAnimatedStateMetaData &MetaData)
 
MOVIESCENE_API void UpdateMetaData (const FPreAnimatedStateMetaData &MetaData)
 
MOVIESCENE_API EPreAnimatedStorageRequirement GetStorageRequirement (const FPreAnimatedStateEntry &Entry) const
 
void OnObjectsReplaced (const TMap< UObject *, UObject * > &ReplacementMap)
 

Static Public Member Functions

template<typename StorageType >
static TPreAnimatedStorageID< StorageType > RegisterStorage ()
 

Public Attributes

uint32 NumRequestsForGlobalState
 

Friends

struct ::FScopedPreAnimatedCaptureSource
 

Detailed Description

Pre-animated state extension that houses all cached values for objects animated by a specific UMovieSceneEntitySystemLinker

- The presence of this extension denotes that pre-animated state should be stored in one form or another.
     If the extension is not present, this implies that there are no IMovieScenePlayers that need global Restore State, and no tracks set to 'Restore State'.
     FPreAnimatedStateExtension::NumRequestsForGlobalState defines whether this extension needs to cache any and all changes or not
- Each specific 'type' of pre-animated state is defined by a unique StorageID (TPreAnimatedStorageID), registered through RegisterStorage
- Pre-animated state is grouped into buckets in order to preserve significant ordering constraints (for instance, each object must restore state in the reverse order it was cached)
- Groups are managed by registered IPreAnimatedStateGroupManager instances. The main implementation is FPreAnimatedObjectGroupManager, which maintains an object to group mapping

Constructor & Destructor Documentation

◆ FPreAnimatedStateExtension()

UE::MovieScene::FPreAnimatedStateExtension::FPreAnimatedStateExtension ( )

◆ ~FPreAnimatedStateExtension()

UE::MovieScene::FPreAnimatedStateExtension::~FPreAnimatedStateExtension ( )

Member Function Documentation

◆ AddMetaData()

void UE::MovieScene::FPreAnimatedStateExtension::AddMetaData ( const FPreAnimatedStateMetaData MetaData)

◆ AddSourceMetaData()

void UE::MovieScene::FPreAnimatedStateExtension::AddSourceMetaData ( const FPreAnimatedStateEntry Entry)

◆ AddStorage()

template<typename StorageType >
void UE::MovieScene::FPreAnimatedStateExtension::AddStorage ( TPreAnimatedStorageID< StorageType >  InStorageID,
TSharedPtr< StorageType >  InStorage 
)
inline

Add a specific storage type to this extension

◆ AddWeakCaptureSource()

void UE::MovieScene::FPreAnimatedStateExtension::AddWeakCaptureSource ( TWeakPtr< IPreAnimatedCaptureSource InWeakMetaData)

◆ AllocateGroup()

FPreAnimatedStorageGroupHandle UE::MovieScene::FPreAnimatedStateExtension::AllocateGroup ( TSharedPtr< IPreAnimatedStateGroupManager GroupManager)

Called by group managers to allocate a new group

◆ AreEntriesInvalidated()

bool UE::MovieScene::FPreAnimatedStateExtension::AreEntriesInvalidated ( ) const
inline

Check whether any previously cached entries may have become invalid due to a recent call to RestoreGlobalState If this function returns true, clients should consider re-saving pre-animated state even if it already did so

◆ ContainsAnyStateForInstanceHandle()

bool UE::MovieScene::FPreAnimatedStateExtension::ContainsAnyStateForInstanceHandle ( FRootInstanceHandle  RootInstanceHandle) const

Search for any captured state that originated from the specified root instance handle WARNING: This is a linear search across all state, and so is potentially very slow

◆ DiscardGlobalState()

void UE::MovieScene::FPreAnimatedStateExtension::DiscardGlobalState ( const FRestoreStateParams Params)

Discards any state for any persistent tokens captured during the course of evaluation without restoring it.

Parameters
ParamsParameters for restoration - if TerminalInstanceHandle is invalid then all state will be discarded, regardless of the instance it was cached from

◆ DiscardStaleObjectState()

void UE::MovieScene::FPreAnimatedStateExtension::DiscardStaleObjectState ( )

Called during Garbage Collection to clean up preanimated state on invalid bound objects. Does not restore state.

◆ DiscardStateForGroup()

void UE::MovieScene::FPreAnimatedStateExtension::DiscardStateForGroup ( FPreAnimatedStorageGroupHandle  GroupHandle)

Discard any and all cached values for the specified group without restoring them.

Note
This function should only be used to forcibly serialize animated values into a level

◆ DiscardStateForStorage()

void UE::MovieScene::FPreAnimatedStateExtension::DiscardStateForStorage ( FPreAnimatedStorageID  StorageID,
FPreAnimatedStorageIndex  StorageIndex 
)

Discard the specified cached value and any and all capture source tracking related to it.

◆ DiscardTransientState()

void UE::MovieScene::FPreAnimatedStateExtension::DiscardTransientState ( )

Discard any transient state and all meta-data for any currently animating objects, whilst preserving the cached values internally. Calling this function will cause any currently animating 'RestoreState' sections to re-cache their values if they are re-evaluated Any 'RestoreState' sections which are deleted or subsequently not-evaluated will not cause their values to be restored

◆ EnsureMetaData()

void UE::MovieScene::FPreAnimatedStateExtension::EnsureMetaData ( const FPreAnimatedStateEntry Entry)

◆ FindGroupManager()

TSharedPtr< GroupManagerType > UE::MovieScene::FPreAnimatedStateExtension::FindGroupManager ( ) const
inline

Find a group manager by its type. Group managers enable logical grouping of entries to ensure the correct restoration order.

Note
The templated type must implement a static GroupManagerID member of type TPreAnimatedStorageID<GroupManagerType>
Returns
A pointer to the group manager, or nullptr if it does not exist.

◆ FindStorage()

template<typename StorageType >
TSharedPtr< StorageType > UE::MovieScene::FPreAnimatedStateExtension::FindStorage ( TPreAnimatedStorageID< StorageType >  InStorageID) const
inline

Find a specific storage type by its ID.

Returns
The typed storage, or nullptr if it does not exist in this linker

◆ FreeGroup()

void UE::MovieScene::FPreAnimatedStateExtension::FreeGroup ( FPreAnimatedStorageGroupHandle  Index)

Called by group managers to free an existing group

◆ GetEntityMetaData()

FPreAnimatedEntityCaptureSource * UE::MovieScene::FPreAnimatedStateExtension::GetEntityMetaData ( ) const

◆ GetEvaluationHookMetaData()

FPreAnimatedEvaluationHookCaptureSources * UE::MovieScene::FPreAnimatedStateExtension::GetEvaluationHookMetaData ( ) const

◆ GetOrCreateEntityMetaData()

FPreAnimatedEntityCaptureSource * UE::MovieScene::FPreAnimatedStateExtension::GetOrCreateEntityMetaData ( )

◆ GetOrCreateEvaluationHookMetaData()

FPreAnimatedEvaluationHookCaptureSources * UE::MovieScene::FPreAnimatedStateExtension::GetOrCreateEvaluationHookMetaData ( )

◆ GetOrCreateGroupManager()

TSharedPtr< GroupManagerType > UE::MovieScene::FPreAnimatedStateExtension::GetOrCreateGroupManager ( )
inline

Get or create a group manager by its type. Group managers enable logical grouping of entries to ensure the correct restoration order.

Note
The templated type must implement a static GroupManagerID member of type TPreAnimatedStorageID<GroupManagerType>
Returns
A pointer to the group manager, or nullptr if it does not exist.

◆ GetOrCreateStorage() [1/2]

template<typename StorageType >
TSharedPtr< StorageType > UE::MovieScene::FPreAnimatedStateExtension::GetOrCreateStorage ( )
inline

Get a specific type of storage, creating it if it does not already exist

Note
The template type must have a static StorageID of type TPreAnimatedStorageID<StorageType>.

◆ GetOrCreateStorage() [2/2]

template<typename StorageType >
TSharedPtr< StorageType > UE::MovieScene::FPreAnimatedStateExtension::GetOrCreateStorage ( TPreAnimatedStorageID< StorageType >  InStorageID)
inline

Get a specific type of storage, creating it if it does not already exist

◆ GetOrCreateTemplateMetaData()

FPreAnimatedTemplateCaptureSources * UE::MovieScene::FPreAnimatedStateExtension::GetOrCreateTemplateMetaData ( )

◆ GetOrCreateTrackInstanceInputMetaData()

FPreAnimatedTrackInstanceInputCaptureSources * UE::MovieScene::FPreAnimatedStateExtension::GetOrCreateTrackInstanceInputMetaData ( )

◆ GetOrCreateTrackInstanceMetaData()

FPreAnimatedTrackInstanceCaptureSources * UE::MovieScene::FPreAnimatedStateExtension::GetOrCreateTrackInstanceMetaData ( )

◆ GetStorageChecked()

TSharedPtr< IPreAnimatedStorage > UE::MovieScene::FPreAnimatedStateExtension::GetStorageChecked ( FPreAnimatedStorageID  InStorageID) const
inline

Get a genericly typed storage entry by its erased ID, failing an assertion if it does not exist

◆ GetStorageRequirement()

EPreAnimatedStorageRequirement UE::MovieScene::FPreAnimatedStateExtension::GetStorageRequirement ( const FPreAnimatedStateEntry Entry) const

◆ GetTemplateMetaData()

FPreAnimatedTemplateCaptureSources * UE::MovieScene::FPreAnimatedStateExtension::GetTemplateMetaData ( ) const

◆ GetTrackInstanceInputMetaData()

FPreAnimatedTrackInstanceInputCaptureSources * UE::MovieScene::FPreAnimatedStateExtension::GetTrackInstanceInputMetaData ( ) const

◆ GetTrackInstanceMetaData()

FPreAnimatedTrackInstanceCaptureSources * UE::MovieScene::FPreAnimatedStateExtension::GetTrackInstanceMetaData ( ) const

◆ HasActiveCaptureSource()

bool UE::MovieScene::FPreAnimatedStateExtension::HasActiveCaptureSource ( ) const

◆ Initialize()

void UE::MovieScene::FPreAnimatedStateExtension::Initialize ( UMovieSceneEntitySystemLinker InLinker)

◆ IsCapturingGlobalState()

bool UE::MovieScene::FPreAnimatedStateExtension::IsCapturingGlobalState ( ) const
inline

Check if this extension has any current requests to capture global (persistent) state entries

◆ MetaDataExists()

bool UE::MovieScene::FPreAnimatedStateExtension::MetaDataExists ( const FPreAnimatedStateEntry Entry) const

◆ OnObjectsReplaced()

void UE::MovieScene::FPreAnimatedStateExtension::OnObjectsReplaced ( const TMap< UObject *, UObject * > &  ReplacementMap)

Called to handle replaced objects

◆ RegisterStorage()

template<typename StorageType >
static TPreAnimatedStorageID< StorageType > UE::MovieScene::FPreAnimatedStateExtension::RegisterStorage ( )
inlinestatic

Called from TAutoRegisterPreAnimatedStorageID to register a new application-wide storage type

◆ RemoveMetaData()

void UE::MovieScene::FPreAnimatedStateExtension::RemoveMetaData ( const FPreAnimatedStateMetaData MetaData)

◆ RemoveWeakCaptureSource()

void UE::MovieScene::FPreAnimatedStateExtension::RemoveWeakCaptureSource ( TWeakPtr< IPreAnimatedCaptureSource InWeakMetaData)

◆ ReplaceObjectForGroup()

void UE::MovieScene::FPreAnimatedStateExtension::ReplaceObjectForGroup ( FPreAnimatedStorageGroupHandle  GroupHandle,
const FObjectKey OldObject,
const FObjectKey NewObject 
)

Called during blueprint re-instancing to replace the object bound to a specific group handle with another.

◆ ResetEntryInvalidation()

void UE::MovieScene::FPreAnimatedStateExtension::ResetEntryInvalidation ( )
inline

Resets the entry invalidation flag

◆ RestoreGlobalState()

void UE::MovieScene::FPreAnimatedStateExtension::RestoreGlobalState ( const FRestoreStateParams Params)

Restore any state for any persistent tokens captured during the course of evaluation

Parameters
ParamsParameters for restoration - if TerminalInstanceHandle is invalid then all state will be restored, regardless of the instance it was cached from

◆ RestoreStateForGroup()

void UE::MovieScene::FPreAnimatedStateExtension::RestoreStateForGroup ( FPreAnimatedStorageGroupHandle  GroupHandle,
const FRestoreStateParams Params 
)

Restore any state cached for the specified group

@params GroupHandle Handle to the group to restore

Parameters
ParamsParameters for restoration

◆ SavePreAnimatedState() [1/2]

void UE::MovieScene::FPreAnimatedStateExtension::SavePreAnimatedState ( FMovieSceneAnimTypeID  InTokenType,
const IMovieScenePreAnimatedGlobalTokenProducer Producer 
)

◆ SavePreAnimatedState() [2/2]

void UE::MovieScene::FPreAnimatedStateExtension::SavePreAnimatedState ( UObject InObject,
FMovieSceneAnimTypeID  InTokenType,
const IMovieScenePreAnimatedTokenProducer Producer 
)

◆ SavePreAnimatedStateDirectly() [1/2]

void UE::MovieScene::FPreAnimatedStateExtension::SavePreAnimatedStateDirectly ( FMovieSceneAnimTypeID  InTokenType,
const IMovieScenePreAnimatedGlobalTokenProducer Producer 
)

◆ SavePreAnimatedStateDirectly() [2/2]

void UE::MovieScene::FPreAnimatedStateExtension::SavePreAnimatedStateDirectly ( UObject InObject,
FMovieSceneAnimTypeID  InTokenType,
const IMovieScenePreAnimatedTokenProducer Producer 
)

◆ UpdateMetaData()

void UE::MovieScene::FPreAnimatedStateExtension::UpdateMetaData ( const FPreAnimatedStateMetaData MetaData)

Friends And Related Symbol Documentation

◆ ::FScopedPreAnimatedCaptureSource

Member Data Documentation

◆ NumRequestsForGlobalState

uint32 UE::MovieScene::FPreAnimatedStateExtension::NumRequestsForGlobalState

The number of requests that have been made to capture global state - only one should exist per playing sequence


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