USMPreviewObject¶
Module: SMPreviewEditor
#include <SMPreviewObject.h>
Inherits from UObject
Description¶
Single object per blueprint to manage simulation data.
Public Functions¶
Protected Functions¶
| Name | |
|---|---|
| void | OnWorldDestroyed(UWorld * World) |
| void | GetAllActorReferences(UObject * InObject, TMap< FName, FName > & PropertyNameValue) const |
| void | RestoreActorReferences(UObject * InObject, ULevel * InLevel, const TMap< FName, FName > & PropertyNameValue) |
| void | SpawnActorForWorld(FSMPreviewObjectSpawner & InOutSpawner) |
| AActor * | SpawnActorForWorld(UWorld * InWorld, UClass * ActorClass, AActor * ActorTemplate, const FTransform & Transform) |
| void | DestroyActor(AActor * Actor) |
| FSMPreviewObjectSpawner * | GetPreviewSpawnerFromActor(AActor * Actor) |
| void | BuildActorMap() |
Public Attributes¶
| Name | |
|---|---|
| FOnPreviewObjectChanged | OnPreviewObjectChangedEvent |
| FOnPreviewObjectChanged | OnWorldRefreshRequiredEvent |
| FOnPreviewObjectChanged | OnSimulationStartedEvent |
| FOnPreviewObjectChanged | OnSimulationEndedEvent |
| FOnPreviewWorldChanged | OnCurrentWorldChangedEvent |
Public Functions Documentation¶
function USMPreviewObject¶
function ~USMPreviewObject¶
function Serialize¶
function PostEditChangeChainProperty¶
virtual void PostEditChangeChainProperty(
FPropertyChangedChainEvent & PropertyChangedEvent
) override
function PostEditUndo¶
function IsEditorOnly¶
function DECLARE_MULTICAST_DELEGATE_OneParam¶
function DECLARE_MULTICAST_DELEGATE_OneParam¶
function InitializeStateMachine¶
Initialize the live state machine instance.
function ShutdownStateMachine¶
Gracefully shutdown the state machine.
function SetFromBlueprint¶
Sets state machine properties from a blueprint.
function GetPreviewStateMachineActor¶
The actor that was spawned in a preview world if any.
Todo:
Deprecate function. We only have a simulated state machine actor now.
function SetPreviewWorld¶
Call before use so the preview object knows what world to spawn and destroy actors.
function SetCurrentWorld¶
The current world: either simulation or preview.
function UpdateGameMode¶
Signal that the game mode has updated.
function SpawnAllActors¶
Spawns context and all preview actors.
function DestroyAllActors¶
Destroys context and all preview actors.
function RefreshPreviewWorldActors¶
Signals to refresh actors, such as after a package has saved.
function ContainsActor¶
Checks if the actor is contained in the spawned actors.
function SaveAllActorReferences¶
Save actor reference paths so they can be restored after an editor reset.
function RestoreAllActorReferences¶
Use saved actor paths to find the real actor references in the world.
function IsSimulationRunning¶
Checks if a state machine is currently running for simulation.
function GetPreviewWorld¶
The current preview world if one exists.
function GetCurrentWorld¶
The preview or simulation world.
function GetStateMachineTemplate¶
function SetSimulatedStateMachineInstance¶
function GetSimulatedStateMachineInstance¶
function GetGameMode¶
function ShouldPossessPawnContext¶
function SetContextActor¶
function GetContextActor¶
function AddPreviewActor¶
Create an initial template and spawn the actor.
function RemovePreviewActor¶
Searches for the preview spawner associated with this actor and removes it and despawns it.
function NotifySimulationStarted¶
Inform the preview object simulation has started.
function NotifySimulationEnded¶
Inform the preview object simulation has ended.
function BindActorDelegates¶
Bind to engine actor delegates.
function ReleaseActorHandles¶
Safely release and reset all delegate handles.
Protected Functions Documentation¶
function OnWorldDestroyed¶
function GetAllActorReferences¶
function RestoreActorReferences¶
void RestoreActorReferences(
UObject * InObject,
ULevel * InLevel,
const TMap< FName, FName > & PropertyNameValue
)
function SpawnActorForWorld¶
function SpawnActorForWorld¶
AActor * SpawnActorForWorld(
UWorld * InWorld,
UClass * ActorClass,
AActor * ActorTemplate,
const FTransform & Transform
)
function DestroyActor¶
Destroy an actor but will not null out actor from the object spawner.
function GetPreviewSpawnerFromActor¶
Find the preview reference from an actor.
function BuildActorMap¶
Quick access to finding a preview spawner given an actor. Should be rebuilt whenever PreviewObjects is modified.
Public Attributes Documentation¶
variable OnPreviewObjectChangedEvent¶
When a property of the preview object has changed.
variable OnWorldRefreshRequiredEvent¶
When the preview object needs a new world.
variable OnSimulationStartedEvent¶
When the simulation first starts.
variable OnSimulationEndedEvent¶
When the simulation ends.
variable OnCurrentWorldChangedEvent¶
When a new world has been set such as from preview to simulation or back.
Private Attributes Documentation¶
variable OnWorldDestroyedHandle¶
variable PieStartedHandle¶
variable ActorMovingHandle¶
variable ActorMovedHandle¶
variable ActorPropertyChangeHandle¶
variable PreviewObjects¶
All objects to spawn into the preview world.
variable ActorNameToPreviewIndex¶
Actor name to the index of the PreviewObjects array.
variable ContextName¶
Actor name to use as the context.
variable CachedContextActor¶
Current context actor for this session.
variable GameMode¶
The game mode to use when simulating.
variable bPossessPawnContext¶
Possess a pawn context with the default player controller when simulating.
variable StateMachineTemplate¶
The state machine to spawn into the simulation world.
variable SimulatedStateMachineInstance¶
The SIMULATED state machine that is running. Hosted under a PreviewStateMachineActor if there is a valid world. This is set externally when a user starts simulation.
variable ActorPropertyToActorName¶
Full property names mapped to actor names.
variable SimulatedStateMachineActor¶
An actor to host a SIMULATED state machine.
variable PreviewWorld¶
The PREVIEW world if one exists.
variable CurrentWorld¶
Either preview or simulation.
variable SpawnedActors¶
Actors currently spawned in the world.
variable bSpawningActor¶
True only during a spawn.
variable bDontModify¶
Prevents Modify() from being called.
variable bIsSaving¶
True during serialize writing.