Navigation
API > API/Plugins > API/Plugins/SceneState
Struct representing an execution. It is used mainly to run a Scene State Object, but is also used in to run the same state machines, state, etc. multiple times. This struct is the place holding the mutable data during execution, as the data residing in the Scene State Generated Class is immutable during execution.
This struct also offers functionality to both get class (immutable) objects (states, state machines, etc) and their instance (mutable) data (state instances, state machine instances, etc).
Prior to execution, ensure that the template data is in a valid state, as it is assumed to be valid during execution to avoid re-checking validity. See USceneStateObject as an example.
| Name | FSceneStateExecutionContext |
| Type | struct |
| Header File | /Engine/Plugins/VirtualProduction/SceneState/Source/SceneState/Public/SceneStateExecutionContext.h |
| Include Path | #include "SceneStateExecutionContext.h" |
Syntax
USTRUCT ()
struct FSceneStateExecutionContext
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FSceneStateExecutionContext() |
SceneStateExecutionContext.h |
Structs
| Name | Remarks |
|---|---|
| FSetupParams |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| InvalidContext | const FSceneStateExecutionContext | SceneStateExecutionContext.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ConduitInstances | TMap< uint16, FSceneStateConduitInstance > | Map of the conduit absolute index to its instance data It's allocated when a state that could evaluate the conduit starts and removed on state exit | SceneStateExecutionContext.h | |
| ContextName | FString | Description of the context | SceneStateExecutionContext.h | |
| ContextObjectWeak | TWeakObjectPtr< UObject > | Weak ptr to the context holding this execution | SceneStateExecutionContext.h | |
| ContextRegistryWeak | TWeakPtr< UE::SceneState::FExecutionContextRegistry > | Weak reference to the registry containing this context | SceneStateExecutionContext.h | |
| EventStreamWeak | TWeakObjectPtr< USceneStateEventStream > | Weak ptr to the event stream for this execution | SceneStateExecutionContext.h | |
| FunctionInstanceBatches | TMap< FPropertyBindingIndex16, FSceneStateFunctionInstanceBatch > | Map of the batch index to the function instances within the batch It's allocated when its owner is setup, and removed on the owners exit | SceneStateExecutionContext.h | |
| FunctionInstanceViews | TMap< uint16, FStructView > | Map of the function absolute index to the view of the function instance It's allocated when its owner is setup, and removed on the owners exit | SceneStateExecutionContext.h | |
| ParentHandle | UE::SceneState::FExecutionContextHandle | Context handle to the parent execution context. Can be invalid. | SceneStateExecutionContext.h | |
| RootObject | TObjectPtr< UObject > | Weak ptr to the root object owning this execution | SceneStateExecutionContext.h | |
| StateInstances | TMap< uint16, FSceneStateInstance > | Map of State Index to its Instance Data It's allocated when the state starts and removed on exit. | SceneStateExecutionContext.h | |
| StateMachineExecutionStack | TArray< uint16, TInlineAllocator< 4 > > | Array of state machine absolute indices from outermost to innermost for this execution context | SceneStateExecutionContext.h | |
| StateMachineInstances | TMap< uint16, FSceneStateMachineInstance > | Map of State Machine Index to its Instance Data It's allocated when the State Machine starts and removed on exit. | SceneStateExecutionContext.h | |
| TaskInstanceContainers | TMap< uint16, FInstancedStructContainer > | Map of State Index to the Task Instance Container It's allocated when the state starts and removed on exit. | SceneStateExecutionContext.h | |
| TemplateData | TObjectPtr< const USceneStateTemplateData > | Object owning the scene state template data | SceneStateExecutionContext.h | |
| TransitionInstances | TMap< uint16, FSceneStateTransitionInstance > | Map of the transition absolute index to its instance data It's allocated when the state starts (along with the other exit transitions) and removed on state exit | SceneStateExecutionContext.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FPropertyBindingDataView FindDataView
(
const FSceneStateBindingDataHandle& InDataHandle |
Finds the data view that matches the given data handle | SceneStateExecutionContext.h | |
FConstStructView FindFunction
(
uint16 InAbsoluteIndex |
Returns the function of this context for the given function absolute index. | SceneStateExecutionContext.h | |
FStructView FindFunctionInstance
(
uint16 InAbsoluteIndex |
Returns the function instance of this context for the given function absolute index. | SceneStateExecutionContext.h | |
FSceneStateConduitInstance * FindOrAddConduitInstance
(
const FSceneStateConduit& InConduit |
Returns the conduit instance of this context for the given conduit, adding a new one if it's not found | SceneStateExecutionContext.h | |
FSceneStateInstance * FindOrAddStateInstance
(
const FSceneState& InState |
Returns the State Instance of this context for the given state, adding a new one if it's not found | SceneStateExecutionContext.h | |
FSceneStateMachineInstance * FindOrAddStateMachineInstance
(
const FSceneStateMachine& InStateMachine |
Returns the State Machine Instance of this context for the given state machine, adding a new one if it's not found | SceneStateExecutionContext.h | |
FInstancedStructContainer * FindOrAddTaskInstanceContainer
(
const FSceneState& InState |
Returns the Task Instance container of this context for the given state, adding a new one if not found | SceneStateExecutionContext.h | |
FSceneStateTransitionInstance * FindOrAddTransitionInstance
(
const FSceneStateTransition& InTransition |
Returns the transition instance of this context for the given transition, adding a new one if it's not found | SceneStateExecutionContext.h | |
FSceneStateInstance * FindStateInstance
(
const FSceneState& InState |
Returns the existing State Instance of this context for the given state. Null if not found | SceneStateExecutionContext.h | |
FSceneStateInstance * FindStateInstance
(
uint16 InAbsoluteIndex |
Returns the existing State Instance of this context for the given state absolute index. | SceneStateExecutionContext.h | |
FSceneStateMachineInstance * FindStateMachineInstance
(
uint16 InAbsoluteIndex |
Returns the existing State Machine Instance of this context for the given state machine absolute index. | SceneStateExecutionContext.h | |
FSceneStateMachineInstance * FindStateMachineInstance
(
const FSceneStateMachine& InStateMachine |
Returns the existing State Machine Instance of this context for the given state machine. | SceneStateExecutionContext.h | |
FConstStructView FindTask
(
uint16 InAbsoluteIndex |
Returns the Task of this context for the given task absolute index. | SceneStateExecutionContext.h | |
FStructView FindTaskInstance
(
uint16 InAbsoluteIndex |
Returns the Task Instance of this context for the given task absolute index. | SceneStateExecutionContext.h | |
FInstancedStructContainer * FindTaskInstanceContainer
(
const FSceneState& InState |
Returns the Task Instance container of this context for the given state, returning null if not found | SceneStateExecutionContext.h | |
FInstancedStructContainer * FindTaskInstanceContainer
(
uint16 InAbsoluteIndex |
Returns the Task Instance container of this context for the given state absolute index, returning null if not found | SceneStateExecutionContext.h | |
FSceneStateTransitionInstance * FindTransitionInstance
(
uint16 InAbsoluteIndex |
Returns the transition instance of this context for the given transition absolute index, or null if not found | SceneStateExecutionContext.h | |
FSceneStateTransitionInstance * FindTransitionInstance
(
const FSceneStateTransition& InTransition |
Returns the transition instance of this context for the given transition, or null if not found | SceneStateExecutionContext.h | |
void ForEachTask
(
const FSceneState& InState, |
Invokes a given callable for each task in the given state | SceneStateExecutionContext.h | |
const FSceneState * GetActiveState
(
const FSceneStateMachine& InStateMachine |
Returns the currently Active State within this context for the given State Machine | SceneStateExecutionContext.h | |
const FSceneStateBindingCollection & GetBindingCollection() |
Gets the binding collection owned by the template data | SceneStateExecutionContext.h | |
const FSceneStateConduit * GetConduit
(
const FSceneStateMachine& InStateMachine, |
Returns the Conduit at the given relative index for the given State Machine | SceneStateExecutionContext.h | |
UObject * GetContextObject() |
Retrieves the Context Object for this Execution | SceneStateExecutionContext.h | |
TSharedPtr< const UE::SceneState::FExecutionContextRegistry > GetContextRegistry() |
Gets the registry that this context is registered to | SceneStateExecutionContext.h | |
const FSceneStateMachine * GetContextStateMachine() |
Returns the most relevant State Machine in the current scope, if any | SceneStateExecutionContext.h | |
const FSceneStateEventHandler * GetEventHandler
(
uint16 InAbsoluteIndex |
Returns the Event Handler at the given absolute Index | SceneStateExecutionContext.h | |
TConstArrayView< FSceneStateEventHandler > GetEventHandlers
(
const FSceneState& InState |
Returns a sliced view of all the Event Handlers in the given State | SceneStateExecutionContext.h | |
USceneStateEventStream * GetEventStream() |
Gets the Event Stream from the Root State if available | SceneStateExecutionContext.h | |
const FString & GetExecutionContextName() |
Returns the Player Debug Name for logging purposes | SceneStateExecutionContext.h | |
UObject * GetRootObject() |
Retrieves the Root Object of this Execution | SceneStateExecutionContext.h | |
const FSceneState * GetState
(
const FSceneStateMachine& InStateMachine, |
Returns the State at the given relative index for the given State Machine | SceneStateExecutionContext.h | |
const FSceneState * GetState
(
uint16 InAbsoluteIndex |
Returns the State at the given absolute index | SceneStateExecutionContext.h | |
const FSceneStateMachine * GetStateMachine
(
uint16 InAbsoluteIndex |
Returns the State Machine at the given absolute index | SceneStateExecutionContext.h | |
const FSceneStateMachine * GetStateMachine
(
const FGuid& InStateMachineId |
Returns the State Machine linked to the given id | SceneStateExecutionContext.h | |
TConstArrayView< FSceneStateMachine > GetStateMachines
(
const FSceneState& InState |
Returns a sliced view of all the Sub State Machines belonging to the given State | SceneStateExecutionContext.h | |
const FSceneStateMetadata * GetStateMetadata
(
const FSceneState& InState |
Returns the State Metadata of a given state | SceneStateExecutionContext.h | |
TConstArrayView< uint16 > GetTaskPrerequisites
(
const FSceneStateTask& InTask |
Returns a sliced view of the prerequisite task indices for a given task, in relative index based on the owning state's task range | SceneStateExecutionContext.h | |
const USceneStateTemplateData * GetTemplateData() |
SceneStateExecutionContext.h | ||
TArray< FConstStructView > GetTemplateTaskInstances
(
const FSceneState& InState |
Returns an array of const views of the Template Task Instances of the given State | SceneStateExecutionContext.h | |
FInstancedPropertyBag GetTemplateTransitionParameter
(
const FSceneStateTransition& InTransition |
Gets the template transition parameter for the given transition | SceneStateExecutionContext.h | |
TConstArrayView< FSceneStateTransition > GetTransitions
(
const FSceneState& InState |
Returns a sliced view of all the Exit Transitions going out of the given State | SceneStateExecutionContext.h | |
TConstArrayView< FSceneStateTransition > GetTransitions
(
const FSceneStateConduit& InConduit |
Returns a sliced view of all the Exit Transitions going out of the given Conduit | SceneStateExecutionContext.h | |
void RemoveConduitInstance
(
const FSceneStateConduit& InConduit |
Removes the conduit instance of this context for the given conduit | SceneStateExecutionContext.h | |
void RemoveFunctionInstances
(
FPropertyBindingIndex16 InBindingsBatch |
Removes the function instance data for a given binding batch | SceneStateExecutionContext.h | |
void RemoveStateInstance
(
const FSceneState& InState |
Removes the State Instance of this context for the given state | SceneStateExecutionContext.h | |
void RemoveStateMachineInstance
(
const FSceneStateMachine& InStateMachine |
Removes the State Machine Instance of this context for the given state machine | SceneStateExecutionContext.h | |
void RemoveTaskInstanceContainer
(
const FSceneState& InState |
Removes the Task instance container of this context for the given state | SceneStateExecutionContext.h | |
void RemoveTransitionInstance
(
const FSceneStateTransition& InTransition |
Removes the transition instance of this context for the given transition | SceneStateExecutionContext.h | |
void Reset() |
Called when cleaning up the instances of this execution | SceneStateExecutionContext.h | |
T * ResolveProperty
(
const FSceneStatePropertyReference& InPropertyReference |
Returns the pointer to the property value address the given reference is mapped to | SceneStateExecutionContext.h | |
void Setup
(
const FSceneStateExecutionContext& InParentContext |
Initialization for a context with a parent context. | SceneStateExecutionContext.h | |
void Setup
(
const FSetupParams& InParams |
Initialization for the Context. | SceneStateExecutionContext.h | |
void Setup
(
TNotNull< USceneStateObject* > InRootState |
Initialization for the Context. | SceneStateExecutionContext.h | |
bool SetupFunctionInstances
(
FPropertyBindingIndex16 InBindingsBatch |
Allocates the function instance data for a given binding batch | SceneStateExecutionContext.h |