Navigation
API > API/Plugins > API/Plugins/LevelSnapshots
Holds the state of a world at a given time. This asset can be used to rollback certain properties in a UWorld.
| Name | ULevelSnapshot |
| Type | class |
| Header File | /Engine/Plugins/VirtualProduction/LevelSnapshots/Source/LevelSnapshots/Public/Data/LevelSnapshot.h |
| Include Path | #include "Data/LevelSnapshot.h" |
Syntax
UCLASS (BlueprintType)
class ULevelSnapshot : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → ULevelSnapshot
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FActorConsumer | TBaseDelegate_OneParam< void, AActor * > | Data/LevelSnapshot.h | |
| FActorPathConsumer | TBaseDelegate_OneParam< void, const FSoftObjectPath & > | Data/LevelSnapshot.h | |
| FSnapshotEvent | TMulticastDelegate_NoParams< void > | Data/LevelSnapshot.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsDiffCacheEnabled | bool | Only used in non-editor builds (should be wrapped in !WITH_EDITORONLY_DATA but UHT does not allow it). | Data/LevelSnapshot.h |
|
| Cache | FSnapshotDataCache | Holds all loaded objects | Data/LevelSnapshot.h |
|
| CachedDiffedActors | TMap< TWeakObjectPtr< AActor >, ECachedDiffResult > | Caches whether an actor was diffed already | Data/LevelSnapshot.h |
|
| CaptureTime | FDateTime | UTC Time that the snapshot was taken | Data/LevelSnapshot.h |
|
| Handle | FDelegateHandle | Callback to destroy our world when editor (editor build) or play (game builds) world is destroyed. | Data/LevelSnapshot.h | |
| MapPath | FSoftObjectPath | Path of the map that the snapshot was taken in | Data/LevelSnapshot.h |
|
| OnObjectModifiedHandle | FDelegateHandle | Callback to when an object is modified. Clears FActorSnapshotData::bHasBeenDiffed | Data/LevelSnapshot.h | |
| OnPostApplySnapshotDelegate | FSnapshotEvent | Data/LevelSnapshot.h | ||
| OnPreApplySnapshotDelegate | FSnapshotEvent | Data/LevelSnapshot.h | ||
| RootSnapshotWorld | TObjectPtr< UWorld > | The root world, equivalent to the persistent world, we will be adding temporary actors to | Data/LevelSnapshot.h |
|
| SerializedData | FWorldSnapshotData | The saved snapshot data | Data/LevelSnapshot.h | |
| SnapshotDescription | FString | User defined description of the snapshot | Data/LevelSnapshot.h |
|
| SnapshotName | FName | User defined name for the snapshot, can differ from the actual asset name. | Data/LevelSnapshot.h |
|
| SnapshotSublevels | TArray< TObjectPtr< UWorld > > | Sublevels of RootSnapshotWorld | Data/LevelSnapshot.h |
|
| TransientWorldPackage | TObjectPtr< UPackage > | Transient package that contains the world. | Data/LevelSnapshot.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ApplySnapshotToWorld
(
UWorld* TargetWorld, |
Applies this snapshot to the given world. | Data/LevelSnapshot.h | |
virtual void BeginDestroy() |
Data/LevelSnapshot.h | ||
void DiffWorld
(
UWorld* World, |
Data/LevelSnapshot.h | ||
void DiffWorld
(
UWorld* World, |
Compares this snapshot to the world and calls the appropriate callbacks: | Data/LevelSnapshot.h | |
TOptional< TNonNullPtr< UClass > > GetActorClass
(
const FSoftObjectPath& OriginalActorPath |
Given an actor path in the world, gets its class from the snapshot. | Data/LevelSnapshot.h | |
FString GetActorLabel
(
const FSoftObjectPath& OriginalActorPath |
Gets the display label of the path of the actor. | Data/LevelSnapshot.h | |
const FSnapshotDataCache & GetCache() |
Data/LevelSnapshot.h | ||
FDateTime GetCaptureTime() |
Data/LevelSnapshot.h |
|
|
TOptional< TNonNullPtr< AActor > > GetDeserializedActor
(
const FSoftObjectPath& OriginalActorPath |
Given an actor path in the world, gets the equivalent actor from the snapshot. | Data/LevelSnapshot.h | |
FSoftObjectPath GetMapPath() |
Data/LevelSnapshot.h |
|
|
int32 GetNumSavedActors() |
Gets the number of actors saved by this snapshot. | Data/LevelSnapshot.h | |
const FWorldSnapshotData & GetSerializedData() |
Data/LevelSnapshot.h | ||
FString GetSnapshotDescription() |
Data/LevelSnapshot.h |
|
|
FName GetSnapshotName() |
Data/LevelSnapshot.h |
|
|
bool HasChangedSinceSnapshotWasTaken
(
AActor* WorldActor |
Checks whether the given actor has changes to the snapshot version. | Data/LevelSnapshot.h | |
bool HasOriginalChangedPropertiesSinceSnapshotWasTaken
(
AActor* SnapshotActor, |
Checks whether the original actor has any properties that changed since the snapshot was taken by comparing properties. | Data/LevelSnapshot.h | |
FSnapshotEvent & OnPostApplySnapshot() |
Data/LevelSnapshot.h | ||
FSnapshotEvent & OnPreApplySnapshot() |
Data/LevelSnapshot.h | ||
void ResetDiffCacheToUninitialized
(
TArrayView< AActor* > ModifiedActors |
Clears the diff state of the actor. | Data/LevelSnapshot.h | |
void ResetDiffCacheToUninitialized
(
UObject* ModifiedObject |
Data/LevelSnapshot.h | ||
void SetSnapshotDescription
(
const FString& InSnapshotDescription |
Data/LevelSnapshot.h |
|
|
void SetSnapshotName
(
const FName& InSnapshotName |
Sets the name of this snapshot. | Data/LevelSnapshot.h |
|
bool SnapshotWorld
(
UWorld* TargetWorld |
Captures the current state of the given world. | Data/LevelSnapshot.h |