Skip to content

USMGraphNode_StateNode

Module: SMSystemEditor

#include <SMGraphNode_StateNode.h>

Inherits from USMGraphNode_StateNodeBase, USMGraphNode_Base, ISMEditorGraphNode_StateBaseInterface, UEdGraphNode, ISMEditorGraphNodeInterface

Description

class USMGraphNode_StateNode;

Regular state nodes which have K2 graphs.

Public Functions

Name
virtual void PostEditChangeProperty(FPropertyChangedEvent & PropertyChangedEvent) override
virtual UObject * GetJumpTargetForDoubleClick() const override
virtual void DestroyNode() override
virtual FSlateIcon GetIconAndTint(FLinearColor & OutColor) const override
virtual void PlaceDefaultInstanceNodes() override
virtual FName GetNodeClassPropertyName() const override
virtual FName GetNodeStackPropertyName() override
virtual FName GetNodeStackElementClassPropertyName() const override
virtual UClass * GetNodeClass() const override
virtual void SetNodeClass(UClass * Class) override
virtual bool SupportsPropertyGraphs() const override
virtual FName GetFriendlyNodeName() const override
virtual const FSlateBrush * GetNodeIcon() const override
virtual void InitTemplate() override
virtual bool AreTemplatesFullyLoaded() const override
virtual bool DoesNodePossiblyHaveConstructionScripts() const override
virtual void RunAllConstructionScripts_Internal() override
virtual void RestoreArchetypeValuesPriorToConstruction() override
virtual void PreCompileNodeInstanceValidation(FCompilerResultsLog & CompilerContext, USMCompilerLog * CompilerLog, USMGraphNode_Base * OwningNode) override
virtual void OnCompile(FSMKismetCompilerContext & CompilerContext) override
virtual int32 GetIndexOfTemplate(const FGuid & TemplateGuid) const override
virtual void GetAllNodeTemplates(TArray< USMNodeInstance * > & OutNodeInstances) const override
virtual USMNodeInstance * AddStackNode(TSubclassOf< USMNodeInstance > NodeClass, int32 StackIndex) override
virtual void RemoveStackNode(int32 StackIndex) override
virtual void ClearStackNodes() override
const TArray< FStateStackContainer > & GetAllNodeStackTemplates() const
virtual USMNodeInstance * GetTemplateFromIndex(int32 Index) const override
void InitStateStack()
void DestroyStateStack()

Public Attributes

Name
TSubclassOf< USMStateInstance > StateClass
TArray< FStateStackContainer > StateStack

Additional inherited members

Public Functions inherited from USMGraphNode_StateNodeBase

Name
virtual void AllocateDefaultPins() override
virtual FText GetNodeTitle(ENodeTitleType::Type TitleType) const override
virtual bool GetCanRenameNode() const override
virtual void OnRenameNode(const FString & NewName) override
virtual void AutowireNewNode(UEdGraphPin * FromPin) override
virtual void PostPlacedNewNode() override
virtual void PostPasteNode() override
virtual void PostEditChangeChainProperty(FPropertyChangedChainEvent & PropertyChangedEvent) override
virtual void PinConnectionListChanged(UEdGraphPin * Pin) override
virtual void ImportDeprecatedProperties() override
virtual void OnNodeMoved(const FVector2D & NewPosition) override
virtual void OnBoundGraphRenamed(UObject * OldOuter, const FName OldName) override
virtual void PreCompile(FSMKismetCompilerContext & CompilerContext) override
virtual void ResetNodeName() override
virtual FGameplayTagContainer & GetAnyStateTags() override
virtual void SetAnyStateTags(const FGameplayTagContainer & InAnyStateTags) override
virtual void SetRuntimeDefaults(FSMState_Base & State) const
virtual FString GetStateName() const
virtual bool IsEndState(bool bCheckAnyState =true) const
virtual bool HasInputConnections() const
virtual bool HasOutputConnections() const
bool ShouldDefaultTransitionsToParallel() const
bool ShouldExcludeFromAnyState() const
bool HasTransitionToNode(const UEdGraphNode * Node) const
bool HasTransitionFromNode(const UEdGraphNode * Node) const
USMGraphNode_Base * GetPreviousNode(int32 Index =0) const
USMGraphNode_Base * GetNextNode(int32 Index =0) const
USMGraphNode_StateNodeBase * GetPreviousState(int32 Index =0, bool bIncludeReroute =false, bool bIncludeEntryState =false) const
USMGraphNode_StateNodeBase * GetNextState(int32 Index =0, bool bIncludeReroute =false) const
USMGraphNode_TransitionEdge * GetPreviousTransition(int32 Index =0) const
USMGraphNode_TransitionEdge * GetNextTransition(int32 Index =0) const
void GetInputTransitions(TArray< USMGraphNode_TransitionEdge * > & OutTransitions) const
void GetOutputTransitions(TArray< USMGraphNode_TransitionEdge * > & OutTransitions) const
int32 GetNumInputConnections() const
int32 GetNumOutputConnections() const
UEdGraphPin * GetConnectedEntryPin() const
FLinearColor GetBackgroundColorForNodeInstance(const USMNodeInstance * NodeInstance) const
const TSet< TObjectPtr< USMGraphNode_LinkStateNode > > & GetLinkStates() const
void RemoveInvalidLinkStates()
void RefreshConnectedTransitions()

Protected Functions inherited from USMGraphNode_StateNodeBase

Name
virtual FLinearColor Internal_GetBackgroundColor() const override

Friends inherited from USMGraphNode_StateNodeBase

Name
class SGraphNode_StateNode
class USMGraphNode_LinkStateNode

Public Functions inherited from USMGraphNode_Base

Name
virtual void Serialize(FArchive & Ar) override
virtual void PostLoad() override
virtual ~USMGraphNode_Base() override
virtual void PostPasteNode() override
virtual void PostEditUndo() override
virtual void PostPlacedNewNode() override
virtual TSharedPtr< INameValidatorInterface > MakeNameValidator() const override
virtual void OnRenameNode(const FString & NewName) override
virtual bool CanJumpToDefinition() const override
virtual void JumpToDefinition() const override
virtual bool CanCreateUnderSpecifiedSchema(const UEdGraphSchema * Schema) const override
virtual void ReconstructNode() override
virtual void PinConnectionListChanged(UEdGraphPin * Pin) override
virtual void ValidateNodeDuringCompilation(FCompilerResultsLog & MessageLog) const override
virtual TScriptInterface< ISMEditorGraphPropertyNodeInterface > GetEditorGraphProperty(FName PropertyName, const USMNodeInstance * NodeInstance, int32 ArrayIndex) const override
virtual TArray< TScriptInterface< ISMEditorGraphPropertyNodeInterface > > GetEditorGraphPropertyAsArray(FName PropertyName, const USMNodeInstance * NodeInstance, int32 ArrayIndex) const override
virtual TArray< TScriptInterface< ISMEditorGraphPropertyNodeInterface > > GetAllEditorGraphProperties(const USMNodeInstance * NodeInstance) const override
virtual FString GetNodeName() const override
virtual bool SetNodeName(const FString & NewName, FText & OutErrorMessage) override
virtual void ResetNodeName() override
virtual TScriptInterface< ISMEditorGraphNode_StateBaseInterface > AsStateBaseInterface() override
virtual void SetNodeName_Direct(const FString & InNewName)
virtual void PreCompile(FSMKismetCompilerContext & CompilerContext)
virtual void OnBoundGraphRenamed(UObject * OldOuter, const FName OldName)
virtual void ResetDebugState()
virtual void OnWidgetConstruct()
virtual void UpdateTime(float DeltaTime)
virtual void CheckSetErrorMessages()
virtual void ResetLogMessages()
void UpdateErrorMessageFromLogs()
void AddNodeLogMessage(const FSMGraphNodeLog & Message)
bool TryGetNodeLogMessage(FString & OutMessage, int32 & OutSeverity) const
virtual void OnNodeMoved(const FVector2D & NewPosition)
void SetReadOnlyNodePosition()
virtual void GoToLocalGraph() const
virtual bool CanGoToLocalGraph() const
virtual TArray< TSubclassOf< USMGraphNode_Base > > GetAllowedDuplicateNodeNameTypes() const
virtual const FGuid & GetCorrectNodeGuid(bool * bIsRunTimeGuid =nullptr) const
virtual void DestroyTemplate()
void RunAllConstructionScripts()
virtual bool CanRunConstructionScripts() const
bool IsRunningConstructionScripts() const
UClass * GetDefaultNodeClass() const
bool IsUsingDefaultNodeClass() const
bool IsNodeClassNative() const
virtual bool IsNodeFastPathEnabled() const
virtual FName GetNodeTemplatePropertyName()
USMNodeInstance * GetNodeTemplate() const
USMNodeInstance * GetNodeTemplateFromGuid(const FGuid & Guid) const
T * GetNodeTemplateAs(bool bCheck =false) const
USMGraph * GetOwningStateMachineGraph() const
UEdGraph * GetBoundGraph() const
void ClearBoundGraph()
void CreateGraphPropertyGraphs(bool bGenerateNewGuids =false)
bool CreateGraphPropertyGraphsForTemplate(USMNodeInstance * Template, bool bGenerateNewGuids, TSet< FGuid > & LiveGuidsInOut, bool bResetNonVariableGuids =false)
void RemoveGraphPropertyGraphsForTemplate(USMNodeInstance * Template)
UEdGraph * GetGraphPropertyGraph(const FGuid & Guid) const
USMGraphK2Node_PropertyNode_Base * GetGraphPropertyNode(const FGuid & Guid) const
USMGraphK2Node_PropertyNode_Base * GetGraphPropertyNode(const FName & VariableName, const USMNodeInstance * TemplateMatch =nullptr, int32 Index =INDEX_NONE) const
TArray< USMGraphK2Node_PropertyNode_Base * > GetGraphPropertyNodes(const FName & VariableName, const USMNodeInstance * TemplateMatch =nullptr, int32 Index =INDEX_NONE) const
const TMap< FGuid, TObjectPtr< UEdGraph > > & GetAllPropertyGraphs() const
const TMap< FGuid, TObjectPtr< USMGraphK2Node_PropertyNode_Base > > & GetAllPropertyGraphNodes() const
TArray< USMGraphK2Node_PropertyNode_Base * > GetAllPropertyGraphNodesAsArray(const USMNodeInstance * TemplateMatch =nullptr) const
void InitPropertyGraphNodes(UEdGraph * PropertyGraph, FSMGraphProperty_Base * Property)
void RefreshAllProperties(bool bModify, bool bSetFromPinFirst =true)
void RefreshPropertyByGuid(const FGuid & Guid, bool bModify, bool bSetFromPinFirst =true)
void ForceRecreateProperties()
void SetGraphPropertyDefaultsFromPins()
void SetPinsFromGraphProperties(bool bUseArchetype)
USMGraphK2Node_PropertyNode_Base * GetPropertyNodeUnderMouse() const
virtual UEdGraphPin * GetInputPin() const
virtual UEdGraphPin * GetOutputPin() const
UEdGraphNode * GetOutputNode() const
void GetAllOutputNodes(TArray< UEdGraphNode * > & OutNodes) const
void GetAllOutputNodesAs(TArray< T * > & OutNodes) const
virtual FLinearColor GetBackgroundColor() const
virtual FLinearColor GetActiveBackgroundColor() const
virtual bool CanExistAtRuntime() const
FSMNode_Base * FindRuntimeNode() const
const FSMNode_Base * GetDebugNode() const
float GetDebugTime() const
virtual float GetMaxDebugTime() const
virtual bool IsDebugNodeActive() const
virtual bool WasDebugNodeActive() const
bool ConvertToCurrentVersion(bool bOnlyOnLoad =true)
bool SetToCurrentVersion()
void ForceSetVersion(int32 NewVersion)
virtual void ImportDeprecatedProperties()
bool IsBeingPasted() const
bool IsPreCompiling() const
bool IsEditUndo() const
void RequestSlateRefresh(bool bFullRefresh =false)
virtual void ResetCachedValues()
void RecordDuplicatedNodeGuid(const FGuid & InGuid)
void NotifySwapPropertyGraphArrayElements(const FName & InPropertyName, int32 IndexA, int32 IndexB, USMNodeInstance * InNodeInstance)
void RunPreCompileValidateForNodeInstance(const USMNodeInstance * InNodeInstance, USMCompilerLog * InCompilerLog)

Protected Functions inherited from USMGraphNode_Base

Name
void DestroyAllPropertyGraphs()
bool IsSafeToConditionallyCompile(EPropertyChangeType::Type ChangeType) const
virtual void OnConvertToCurrentVersion(bool bOnlyOnLoad)
virtual FLinearColor Internal_GetBackgroundColor() const
const FLinearColor * GetCustomBackgroundColor(const USMNodeInstance * NodeInstance =nullptr) const
void RemovePropertyGraph(USMPropertyGraph * PropertyGraph, bool RemoveFromMaps)
void HandlePropertyGraphArrayRemoval(TArray< FSMGraphProperty_Base * > & GraphProperties, TArray< TSharedPtr< FSMGraphProperty > > & TempGraphProperties, FProperty * TargetProperty, int32 RemovalIndex, int32 ArraySize, const FSMGraphProperty * OverrideGraphProperty, USMNodeInstance * Template)
void HandlePropertyGraphArrayInsertion(TArray< FSMGraphProperty_Base * > & GraphProperties, TArray< TSharedPtr< FSMGraphProperty > > & TempGraphProperties, FProperty * TargetProperty, int32 InsertionIndex, int32 ArraySize, const FSMGraphProperty * OverrideGraphProperty, USMNodeInstance * Template, bool bDuplicate =false)
void HandlePropertyGraphArraySwap(TArray< FSMGraphProperty_Base * > & GraphProperties, int32 IndexA, int32 IndexB, USMNodeInstance * Template)
void HandleOnPropertyChangedEvent(UObject * InObject, FPropertyChangedEvent & InPropertyChangedEvent)
int32 GetLoadedVersion() const

Public Attributes inherited from USMGraphNode_Base

Name
bool bGenerateTemplateOnNodePlacement
uint32 bRequiresGuidRegeneration
uint32 bNeedsStateStackConversion
uint32 bTEST_ForceNoTemplateGuid
TMap< FString, bool > PropertyCategoriesExpanded

Protected Attributes inherited from USMGraphNode_Base

Name
bool bPostEditChangeConstructionRequiresFullRefresh
TArray< FSMGraphNodeLog > CollectedLogs
TObjectPtr< UEdGraph > BoundGraph
FVector2D NodePosition
TObjectPtr< USMNodeInstance > NodeInstanceTemplate
TMap< FGuid, TObjectPtr< UEdGraph > > GraphPropertyGraphs
TMap< FGuid, TObjectPtr< USMGraphK2Node_PropertyNode_Base > > GraphPropertyNodes
TMap< FGuid, TObjectPtr< USMNodeInstance > > GraphPropertyTemplates
TSet< FGuid > DuplicatedNodeGuids
TSharedPtr< FSlateBrush > CachedBrush
FString CachedTexture
FVector2D CachedTextureSize
FLinearColor CachedNodeTintColor
float DebugTotalTime
float MaxTimeToShowDebug
uint32 bIsDebugActive
uint32 bWasDebugActive
uint32 bIsPreCompiling
uint32 bJustPasted
uint32 bIsEditUndo
uint32 bCreatePropertyGraphsOnPropertyChange
uint32 bCreatePropertyGraphsSilently
uint32 bChangeFromRedirect

Friends inherited from USMGraphNode_Base

Name
class SGraphNode_BaseNode

Public Functions inherited from ISMEditorGraphNode_StateBaseInterface

Name
virtual FGameplayTagContainer & GetAnyStateTags() =0
images/classes/SMEditorGraphNode_StateBaseInterface/img/nd_img_GetAnyStateTags.png
virtual void SetAnyStateTags(const FGameplayTagContainer & InAnyStateTags) =0
images/classes/SMEditorGraphNode_StateBaseInterface/img/nd_img_SetAnyStateTags.png

Public Functions inherited from ISMEditorGraphNodeInterface

Name
virtual TScriptInterface< ISMEditorGraphPropertyNodeInterface > GetEditorGraphProperty(FName PropertyName, const USMNodeInstance * NodeInstance, int32 ArrayIndex =0) const =0
images/classes/SMEditorGraphNodeInterface/img/nd_img_GetEditorGraphProperty.png
virtual TArray< TScriptInterface< ISMEditorGraphPropertyNodeInterface > > GetEditorGraphPropertyAsArray(FName PropertyName, const USMNodeInstance * NodeInstance, int32 ArrayIndex =-1) const =0
images/classes/SMEditorGraphNodeInterface/img/nd_img_GetEditorGraphPropertyAsArray.png
virtual TArray< TScriptInterface< ISMEditorGraphPropertyNodeInterface > > GetAllEditorGraphProperties(const USMNodeInstance * NodeInstance) const =0
images/classes/SMEditorGraphNodeInterface/img/nd_img_GetAllEditorGraphProperties.png
virtual FString GetNodeName() const =0
images/classes/SMEditorGraphNodeInterface/img/nd_img_GetNodeName.png
virtual bool SetNodeName(const FString & NewName, FText & OutErrorMessage) =0
images/classes/SMEditorGraphNodeInterface/img/nd_img_SetNodeName.png
virtual void ResetNodeName() =0
images/classes/SMEditorGraphNodeInterface/img/nd_img_ResetNodeName.png
virtual TScriptInterface< ISMEditorGraphNode_StateBaseInterface > AsStateBaseInterface() =0
images/classes/SMEditorGraphNodeInterface/img/nd_img_AsStateBaseInterface.png

Public Functions Documentation

function PostEditChangeProperty

virtual void PostEditChangeProperty(
    FPropertyChangedEvent & PropertyChangedEvent
) override

Reimplements: USMGraphNode_Base::PostEditChangeProperty


function GetJumpTargetForDoubleClick

virtual UObject * GetJumpTargetForDoubleClick() const override

Reimplements: USMGraphNode_Base::GetJumpTargetForDoubleClick


function DestroyNode

virtual void DestroyNode() override

Reimplements: USMGraphNode_StateNodeBase::DestroyNode


function GetIconAndTint

virtual FSlateIcon GetIconAndTint(
    FLinearColor & OutColor
) const override

function PlaceDefaultInstanceNodes

virtual void PlaceDefaultInstanceNodes() override

Place default nodes when a class is selected.

Reimplements: USMGraphNode_Base::PlaceDefaultInstanceNodes


function GetNodeClassPropertyName

inline virtual FName GetNodeClassPropertyName() const override

Return the correct node class property name for the node type.

Reimplements: USMGraphNode_Base::GetNodeClassPropertyName


function GetNodeStackPropertyName

inline virtual FName GetNodeStackPropertyName() override

Reimplements: USMGraphNode_Base::GetNodeStackPropertyName


function GetNodeStackElementClassPropertyName

inline virtual FName GetNodeStackElementClassPropertyName() const override

Reimplements: USMGraphNode_Base::GetNodeStackElementClassPropertyName


function GetNodeClass

inline virtual UClass * GetNodeClass() const override

Return the correct node class. This should be a TSubClass property in child nodes.

Reimplements: USMGraphNode_Base::GetNodeClass


function SetNodeClass

virtual void SetNodeClass(
    UClass * Class
) override

Reimplements: USMGraphNode_Base::SetNodeClass


function SupportsPropertyGraphs

inline virtual bool SupportsPropertyGraphs() const override

If property graphs can be placed within this node.

Reimplements: USMGraphNode_Base::SupportsPropertyGraphs


function GetFriendlyNodeName

inline virtual FName GetFriendlyNodeName() const override

Reimplements: USMGraphNode_Base::GetFriendlyNodeName


function GetNodeIcon

virtual const FSlateBrush * GetNodeIcon() const override

The icon image to use.

Reimplements: USMGraphNode_Base::GetNodeIcon


function InitTemplate

virtual void InitTemplate() override

Instantiate a template for use as an archetype.

Reimplements: USMGraphNode_Base::InitTemplate


function AreTemplatesFullyLoaded

virtual bool AreTemplatesFullyLoaded() const override

Reimplements: USMGraphNode_Base::AreTemplatesFullyLoaded


function DoesNodePossiblyHaveConstructionScripts

virtual bool DoesNodePossiblyHaveConstructionScripts() const override

Check if this node might have construction scripts.

Reimplements: USMGraphNode_Base::DoesNodePossiblyHaveConstructionScripts


function RunAllConstructionScripts_Internal

virtual void RunAllConstructionScripts_Internal() override

Runs all template construction scripts core behavior.

Reimplements: USMGraphNode_Base::RunAllConstructionScripts_Internal


function RestoreArchetypeValuesPriorToConstruction

virtual void RestoreArchetypeValuesPriorToConstruction() override

Restore specific construction scripts values.

Reimplements: USMGraphNode_Base::RestoreArchetypeValuesPriorToConstruction


function PreCompileNodeInstanceValidation

virtual void PreCompileNodeInstanceValidation(
    FCompilerResultsLog & CompilerContext,
    USMCompilerLog * CompilerLog,
    USMGraphNode_Base * OwningNode
) override

Called during kismet pre-compile specifically for node instances to run custom validation.

Reimplements: USMGraphNode_Base::PreCompileNodeInstanceValidation


function OnCompile

virtual void OnCompile(
    FSMKismetCompilerContext & CompilerContext
) override

Called during kismet compile after this node has been cloned.

Reimplements: USMGraphNode_Base::OnCompile


function GetIndexOfTemplate

virtual int32 GetIndexOfTemplate(
    const FGuid & TemplateGuid
) const override

Retrieve the array index from the template guid.

Return: the array index or INDEX_NONE if not found.

Reimplements: USMGraphNode_Base::GetIndexOfTemplate


function GetAllNodeTemplates

virtual void GetAllNodeTemplates(
    TArray< USMNodeInstance * > & OutNodeInstances
) const override

Return every node template, starting with primary node template, followed by any stack items. All possible indices are filled so some items might be nullptr.

Reimplements: USMGraphNode_Base::GetAllNodeTemplates


function AddStackNode

virtual USMNodeInstance * AddStackNode(
    TSubclassOf< USMNodeInstance > NodeClass,
    int32 StackIndex
) override

Add a stack node to the graph node if applicable. Currently only supports state stacks.

Parameters:

NodeClass
The node class to be created.
StackIndex
The index to insert the node stack. Leave at -1 to place at the end.

Return: The stack instance created.

Note:

Instead of calling directly use the USMStateInstance methods to manipulate the state stack during construction.

Reimplements: USMGraphNode_Base::AddStackNode


function RemoveStackNode

virtual void RemoveStackNode(
    int32 StackIndex
) override

Remove a stack node by index. Currently only supports state stacks.

Parameters:

StackIndex
The index to remove. Leave at -1 to remove from the end.

Note:

Instead of calling directly use the USMStateInstance methods to manipulate the state stack during construction.

Reimplements: USMGraphNode_Base::RemoveStackNode


function ClearStackNodes

virtual void ClearStackNodes() override

Remove all nodes from the stack. Currently only supports state stacks.

Note:

Instead of calling directly use the USMStateInstance methods to manipulate the state stack during construction.

Reimplements: USMGraphNode_Base::ClearStackNodes


function GetAllNodeStackTemplates

const TArray< FStateStackContainer > & GetAllNodeStackTemplates() const

Return all state stack templates.


function GetTemplateFromIndex

virtual USMNodeInstance * GetTemplateFromIndex(
    int32 Index
) const override

Retrieve the template instance from an index.

Return: the NodeInstance template.

Reimplements: USMGraphNode_Base::GetTemplateFromIndex


function InitStateStack

void InitStateStack()

function DestroyStateStack

void DestroyStateStack()

Public Attributes Documentation

variable StateClass

TSubclassOf< USMStateInstance > StateClass;

Select a custom node class to use for this node. This can be a blueprint or C++ class.


variable StateStack

TArray< FStateStackContainer > StateStack;

Augment the state by adding additional state classes to perform logic processing.