Navigation
API > API/Runtime > API/Runtime/MovieScene > API/Runtime/MovieScene/Evaluation > API/Runtime/MovieScene/Evaluation/PreAnimatedState
Inheritance Hierarchy
- TSharedFromThis< IPreAnimatedStorage >
- IPreAnimatedStorage
- TPreAnimatedStateStorage
- FAnimTypePreAnimatedStateObjectStorage
- FAnimTypePreAnimatedStateRootStorage
- TPreAnimatedPropertyStorageImpl< PropertyTraits, TPropertyMetaData< MetaDataTypes... >, TIntegerSequence< int, MetaDataIndices... > >
- TPreAnimatedStateStorage_ObjectTraits
- TSimplePreAnimatedStateStorage
References
Module | MovieScene |
Header | /Engine/Source/Runtime/MovieScene/Public/Evaluation/PreAnimatedState/MovieScenePreAnimatedStateStorage.h |
Include | #include "Evaluation/PreAnimatedState/MovieScenePreAnimatedStateStorage.h" |
Syntax
template<typename StorageTraits>
struct TPreAnimatedStateStorage : public UE::MovieScene::IPreAnimatedStorage
Remarks
Storage container for a specific type of pre-animated state as defined by the specified traits.
Reference collection for KeyType and StorageType is automatically provided by way of an optional AddReferencedObjectForComponent override
Traits must include a type definition or using alias for its KeyType and StorageType, defining the type of key to use for associating the pre-animated value and the storage value type respectively.
Additionally, traits must define a RestorePreAnimatedValue function that will be used by the storage container to restore data back to its previous value.
An example trait that maps an object and a name identifier to a string would look like this: struct FExampleTraits { using KeyType = TTuple
static void RestorePreAnimatedValue(const KeyType& InKey, const FString& PreviousString, const FRestoreStateParams& Params) { if (UMyObjectType* Object = Cast
Furthermore, if the CachePreAnimatedValuesTask is used, traits must implement a CachePreAnimatedValue function that receives the contributor component types, and returns the cached value:
static FString CachePreAnimatedValue(UObject* InObject, const FName& StringName) { UMyObjectType* Object = CastChecked
Traits may be stateful if desired. Stateful traits must be provided to the constructor in order to be valid.
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
TMap< KeyType, FPreAnimatedStorageIndex > | KeyToStorageIndex | Map that associates a storage index with a key. |
![]() |
FPreAnimatedStateExtension * | ParentExtension | Pointer to our parent extension |
![]() |
TSparseArray< FCachedData > | PreAnimatedStorage | Sparse array of cached data that represents persistent, or both persistent and transient storage (but never exclusively transient storage). |
![]() |
const IRestoreMask * | RestoreMask | Temporary restoration mask |
![]() |
FPreAnimatedStorageID | StorageID | Our storage ID |
![]() |
StorageTraits | Traits | Traits instance - normally not required but some traits require state |
![]() |
TSortedMap< FPreAnimatedStorageIndex, StorageType > | TransientPreAnimatedStorage | Storage that holds values that need to be kept transiently (for evaluation). |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
|||
![]() |
TPreAnimatedStateStorage
(
StorageTraits&& InTraits |
||
![]() |
TPreAnimatedStateStorage
(
const TPreAnimatedStateStorage& |
Pre-Animated storage is not copyable |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
void | AssignPreAnimatedValue
(
FPreAnimatedStorageIndex StorageIndex, |
Assign the value for a specific storage index. It is an error to re-assign an already cached value. |
![]() |
void | BeginTrackingAndCachePreAnimatedValues
(
UMovieSceneEntitySystemLinker* Linker, |
Look at any entity with the specified component types, and set up new associations with storage indices for those entities, whilst also caching pre-animated values at the same time. |
![]() |
void | BeginTrackingAndCachePreAnimatedValuesTask
(
UMovieSceneEntitySystemLinker* Linker, |
Look at any entity with the specified component types, and set up new associations with storage indices for those entities, whilst also caching pre-animated values at the same time. |
![]() |
void | BeginTrackingEntities
(
UMovieSceneEntitySystemLinker* Linker, |
Look at any entity with the specified component types, and set up new associations with storage indices for those entities The provided component values are put together to make up the storage key WARNING: Does not cache actual pre-animated values |
![]() |
void | BeginTrackingEntitiesTask
(
UMovieSceneEntitySystemLinker* Linker, |
Look at any entity with the specified component types, and set up new associations with storage indices for those entities The provided component values are put together to make up the storage key WARNING: Does not cache actual pre-animated values |
![]() |
void | BeginTrackingEntity
(
FMovieSceneEntityID EntityID, |
Set up a new associations with a storage index for the given entity The provided component values are put together to make up the storage key WARNING: Does not cache actual pre-animated values |
![]() |
void | CachePreAnimatedValue
(
FPreAnimatedStorageGroupHandle GroupHandle, |
Save pre-animated state for the specified group and key using a callback. |
![]() |
void | CachePreAnimatedValue
(
const KeyType& InKey, |
Save pre-animated state for the specified group and key using a callback. |
![]() |
void | CachePreAnimatedValue
(
ContributorTypes... Values |
Save pre-animated state for the specified values, using CacheIfTracked tracking Requires that the traits class implements CachePreAnimatedValue(ContributorTypes...) |
![]() |
void | CachePreAnimatedValues
(
UMovieSceneEntitySystemLinker* Linker, |
Cache pre-animated values for entities with the specified component types |
![]() |
void | CachePreAnimatedValuesTask
(
UMovieSceneEntitySystemLinker* Linker, |
Cache pre-animated values for entities with the specified component types |
![]() |
void | CacheTrackedPreAnimatedValue
(
EPreAnimatedCaptureSourceTracking TrackingMode, |
Save pre-animated state for the specified values Requires that the traits class implements CachePreAnimatedValue(ContributorTypes...) |
![]() |
FPreAnimatedStateEntry | FindEntry
(
KeyArgs&&... InKeyArgs |
Given a list of arguments suitable for building a storage key, builds that key, and then tries to find an existing pre-animated state entry for that key if it already exists. |
![]() ![]() |
FPreAnimatedStorageIndex | FindStorageIndex
(
const KeyType& InKey |
Attempt to find a storage index for the specified key |
![]() |
void | ForciblyPersistStorage
(
FPreAnimatedStorageIndex StorageIndex |
Cause a previously cached value to always outlive any actively animating sources. |
![]() ![]() |
const StorageType & | GetCachedValue
(
FPreAnimatedStorageIndex StorageIndex |
Get the cached value associated with a particular storage index |
![]() ![]() |
const KeyType & | GetKey
(
FPreAnimatedStorageIndex StorageIndex |
Get the key associated with a particular storage index |
![]() |
FPreAnimatedStorageIndex | GetOrCreateStorageIndex
(
const KeyType& InKey |
Attempt to find a storage index for the specified key, creating a new one if it doesn't exist |
![]() ![]() |
bool | HasEverAnimated
(
FPreAnimatedStorageIndex StorageIndex |
Check whether we have ever animated the specified storage index. |
![]() ![]() |
bool | IsStorageInitialized
(
FPreAnimatedStorageIndex StorageIndex |
Check whether a piece of cached storage has been initialized yet. |
![]() ![]() |
bool | IsStorageRequirementSatisfied
(
FPreAnimatedStorageIndex StorageIndex, |
Check whether the storage for a given index and requirement has already been initialized |
![]() |
FPreAnimatedStateEntry | MakeEntry
(
KeyArgs&&... InKeyArgs |
Creates a new pre-animated state entry from a list of arguments suitable for building the storage key. |
![]() |
void | ReplaceKey
(
FPreAnimatedStorageIndex StorageIndex, |
Replace the key associated with a particular storage index |
![]() |
void | SetRestoreMask
(
const IRestoreMask* InRestoreMask |
Called prior to restoring pre-animated state to control whether this storage should restore state or not |
![]() |
bool | ShouldTrackCaptureSource
(
EPreAnimatedCaptureSourceTracking TrackingMode, |
|
![]() |
void | TrackCaptureSource
(
const FPreAnimatedStateEntry& Entry, |
Begins tracking the current entry with the currently set tracking source, if necessary/desirable. |
Overridden from IPreAnimatedStorage
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
void | AddReferencedObjects
(
FReferenceCollector& ReferenceCollector |
Called by the owning extension to add reference collection tracking for pre-animated state |
![]() ![]() |
EPreAnimatedStorageRequirement | DiscardPreAnimatedStateStorage
(
FPreAnimatedStorageIndex StorageIndex, |
Discard a specified index within this storage container. |
![]() ![]() ![]() |
FPreAnimatedStorageID | Retrieve the ID that uniquely identifies this storage container | |
![]() ![]() |
void | Initialize
(
FPreAnimatedStorageID InStorageID, |
Called when this storage is created inside the pre-animated state extension on a UMovieSceneEntitySystemLinker |
![]() ![]() |
void | OnObjectReplaced
(
FPreAnimatedStorageIndex StorageIndex, |
|
![]() ![]() |
EPreAnimatedStorageRequirement | RestorePreAnimatedStateStorage
(
FPreAnimatedStorageIndex StorageIndex, |
Restore a specified index within this storage container. |
Operators
Type | Name | Description | |
---|---|---|---|
![]() |
TPreAnimatedStateStorage & | operator=
(
const TPreAnimatedStateStorage& |
Classes
Type | Name | Description | |
---|---|---|---|
![]() |
FCachedData | ||
![]() |
IRestoreMask | Interface used for restoring pre-animated state that allows an external system to control whether state should be restored or not |
Typedefs
Name | Description |
---|---|
KeyType | The key type to use as a key in the map that associates pre-animated state values to owners (ie, an object and property name) |
StorageType | The value type this storage should store (ie, the actual property type) |