URigVMController

The Controller is the sole authority to perform changes on the Graph.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

RigVMDeveloper

Header

/Engine/Source/Developer/RigVMDeveloper/Public/RigVMModel/RigVMController.h

Include

#include "RigVMModel/RigVMController.h"

Syntax

class URigVMController : public UObject

Remarks

The Controller is the sole authority to perform changes on the Graph. The Controller itself is stateless. The Controller offers a Modified event to subscribe to for user interface views - so they can be informed about any change that's happening within the Graph. The Controller routes all changes through the Graph itself, so you can have N Controllers performing edits on 1 Graph, and N Views subscribing to 1 Controller. In Python you can also subscribe to this event to be able to react to topological changes of the Graph there.

Variables

Name Description

Public variable

FRigVMControlle...

 

UnfoldStructDelegate

A delegate that can be set to change the struct unfolding behaviour.

Constructors

Name Description

Public function

URigVMController()

Default constructor.

Public function

URigVMController

(
    const FObjectInitializer& ObjectIn...
)

Destructors

Name Description

Public function

~URigVMController()

Default destructor.

Functions

Name Description

Public function

FString

 

AddArrayPin

(
    const FString& InArrayPinPath,
    const FString& InDefaultValue,
    bool bUndo
)

Adds an array element pin to the end of an array pin.

Public function

URigVMBranch...

 

AddBranchNode

(
    const FVector2D& InPosition,
    const FString& InNodeName,
    bool bUndo
)

Adds a branch node to the graph.

Public function

URigVMCommen...

 

AddCommentNode

(
    const FString& InCommentText,
    const FVector2D& InPosition,
    const FVector2D& InSize,
    const FLinearColor& InColor,
    const FString& InNodeName,
    bool bUndo
)

Adds a Comment Node to the edited Graph.

Public function

URigVMEnumNo...

 

AddEnumNode

(
    const FName& InCPPTypeObjectPath,
    const FVector2D& InPosition,
    const FString& InNodeName,
    bool bUndo
)

Adds an enum node to the graph Enum nodes can be used to represent constant enum values within the graph

Public function

URigVMRerout...

 

AddFreeRerouteNode

(
    bool bShowAsFullNode,
    const FString& InCPPType,
    const FName& InCPPTypeObjectPath,
    bool bIsConstant,
    const FName& InCustomWidgetName,
    const FString& InDefaultValue,
    const FVector2D& InPosition,
    const FString& InNodeName,
    bool bUndo
)

Adds a free Reroute Node.

Public function

URigVMIfNode...

 

AddIfNode

(
    const FString& InCPPType,
    const FName& InCPPTypeObjectPath,
    const FVector2D& InPosition,
    const FString& InNodeName,
    bool bUndo
)

Adds an if node to the graph. If nodes can be used to pick between two values based on a condition.

Public function

URigVMInject...

 

AddInjectedNode

(
    const FString& InPinPath,
    bool bAsInput,
    UScriptStruct* InScriptStruct,
    const FName& InMethodName,
    const FName& InInputPinName,
    const FName& InOutputPinName,
    const FString& InNodeName,
    bool bUndo
)

Adds a Function / Struct Node to the edited Graph as an injected node StructNode represent a RIGVM_METHOD declaration on a USTRUCT.

Public function

URigVMInject...

 

AddInjectedNodeFromStructPath

(
    const FString& InPinPath,
    bool bAsInput,
    const FString& InScriptStructPath,
    const FName& InMethodName,
    const FName& InInputPinName,
    const FName& InOutputPinName,
    const FString& InNodeName,
    bool bUndo
)

Adds a Function / Struct Node to the edited Graph as an injected node StructNode represent a RIGVM_METHOD declaration on a USTRUCT.

Public function

bool

 

AddLink

(
    const FString& InOutputPinPath,
    const FString& InInputPinPath,
    bool bUndo
)

Adds a link to the graph. This causes a LinkAdded modified event.

Public function

URigVMParame...

 

AddParameterNode

(
    const FName& InParameterName,
    const FString& InCPPType,
    UObject* InCPPTypeObject,
    bool bIsInput,
    const FString& InDefaultValue,
    const FVector2D& InPosition,
    const FString& InNodeName,
    bool bUndo
)

Adds a Parameter Node to the edited Graph.

Public function

URigVMParame...

 

AddParameterNodeFromObjectPath

(
    const FName& InParameterName,
    const FString& InCPPType,
    const FString& InCPPTypeObjectPath,
    bool bIsInput,
    const FString& InDefaultValue,
    const FVector2D& InPosition,
    const FString& InNodeName,
    bool bUndo
)

Adds a Parameter Node to the edited Graph given a struct object path name.

Public function

void

 

AddPinRedirector

(
    bool bInput,
    bool bOutput,
    const FString& OldPinPath,
    const FString& NewPinPath
)

Public function

URigVMProtot...

 

AddPrototypeNode

(
    const FName& InNotation,
    const FVector2D& InPosition,
    const FString& InNodeName,
    bool bUndo
)

Adds a prototype node to the graph.

Public function

URigVMRerout...

 

AddRerouteNodeOnLink

(
    URigVMLink* InLink,
    bool bShowAsFullNode,
    const FVector2D& InPosition,
    const FString& InNodeName,
    bool bUndo
)

Adds a Reroute Node on an existing Link to the edited Graph.

Public function

URigVMRerout...

 

AddRerouteNodeOnLinkPath

(
    const FString& InLinkPinPathRepres...,
    bool bShowAsFullNode,
    const FVector2D& InPosition,
    const FString& InNodeName,
    bool bUndo
)

Adds a Reroute Node on an existing Link to the edited Graph given the Link's string representation.

Public function

URigVMRerout...

 

AddRerouteNodeOnPin

(
    const FString& InPinPath,
    bool bAsInput,
    bool bShowAsFullNode,
    const FVector2D& InPosition,
    const FString& InNodeName,
    bool bUndo
)

Adds a Reroute Node on an existing Pin to the editor Graph.

Public function

URigVMSelect...

 

AddSelectNode

(
    const FString& InCPPType,
    const FName& InCPPTypeObjectPath,
    const FVector2D& InPosition,
    const FString& InNodeName,
    bool bUndo
)

Adds a select node to the graph.

Public function

URigVMStruct...

 

AddStructNode

(
    UScriptStruct* InScriptStruct,
    const FName& InMethodName,
    const FVector2D& InPosition,
    const FString& InNodeName,
    bool bUndo
)

To move this code into the runtime in the future.

Public function

URigVMStruct...

 

AddStructNodeFromStructPath

(
    const FString& InScriptStructPath,
    const FName& InMethodName,
    const FVector2D& InPosition,
    const FString& InNodeName,
    bool bUndo
)

Adds a Function / Struct Node to the edited Graph given its struct object path name.

Public function

URigVMVariab...

 

AddVariableNode

(
    const FName& InVariableName,
    const FString& InCPPType,
    UObject* InCPPTypeObject,
    bool bIsGetter,
    const FString& InDefaultValue,
    const FVector2D& InPosition,
    const FString& InNodeName,
    bool bUndo
)

Adds a Variable Node to the edited Graph.

Public function

URigVMVariab...

 

AddVariableNodeFromObjectPath

(
    const FName& InVariableName,
    const FString& InCPPType,
    const FString& InCPPTypeObjectPath,
    bool bIsGetter,
    const FString& InDefaultValue,
    const FVector2D& InPosition,
    const FString& InNodeName,
    bool bUndo
)

Adds a Variable Node to the edited Graph given a struct object path name.

Public function

bool

 

BreakAllLinks

(
    const FString& InPinPath,
    bool bAsInput,
    bool bUndo
)

Removes all links on a given pin from the graph.

Public function

bool

 

BreakLink

(
    const FString& InOutputPinPath,
    const FString& InInputPinPath,
    bool bUndo
)

Removes a link from the graph. This causes a LinkRemoved modified event.

Public function

bool

 

CancelUndoBracket()

Cancels an undo bracket / scoped transaction.

Public function

bool

 

CanImportNodesFromText

(
    const FString& InText
)

Exports the given nodes as text.

Public function

void

 

ChangeVariableNodesType

(
    const FName& InVarName,
    const FString& InCPPType,
    UObject* InCPPTypeObject,
    bool bUndo
)

Changes the data type of all nodes matching a given variable name.

Public function

bool

 

ClearArrayPin

(
    const FString& InArrayPinPath,
    bool bUndo
)

Removes all (but one) array element pin from an array pin.

Public function

bool

 

ClearNodeSelection

(
    bool bUndo
)

Deselects all currently selected nodes in the graph.

Public function

bool

 

CloseUndoBracket()

Closes an undo bracket / scoped transaction.

Public function

int32

 

DetachLinksFromPinObjects()

Public function

FString

 

DuplicateArrayPin

(
    const FString& InArrayElementPinPa...,
    bool bUndo
)

Duplicates an array element pin. This causes a PinArraySizeChanged modified event.

Public function

URigVMNode &...

 

EjectNodeFromPin

(
    const FString& InPinPath,
    bool bUndo
)

Ejects the last injected node on a pin.

Public function

void

 

EnableReporting

(
    bool bEnabled
)

Enables or disables the error reporting of this Controller.

Public function

FString

 

ExportNodesToText

(
    const TArray< FName >& InNodeNames
)

Exports the given nodes as text.

Public function

FString

 

ExportSelectedNodesToText()

Exports the selected nodes as text.

Public function Const

URigVMGraph ...

 

GetGraph()

Returns the currently edited Graph of this controller.

Public function

FString

 

GetPinDefaultValue

(
    const FString& InPinPath
)

Returns the default value of a pin given its pinpath.

Public function Static

FName

 

GetUniqueName

(
    const FName& InName,
    TFunction< bool&)> IsN...
)

Returns a unique name.

Public function

TArray< FNam...

 

ImportNodesFromText

(
    const FString& InText,
    bool bUndo
)

Exports the given nodes as text.

Public function

FString

 

InsertArrayPin

(
    const FString& InArrayPinPath,
    int32 InIndex,
    const FString& InDefaultValue,
    bool bUndo
)

Inserts an array element pin into an array pin. This causes a PinArraySizeChanged modified event.

Public function Const

bool

 

IsReportingEnabled()

Returns true if reporting is enabled.

Public function

void

 

Notify

(
    ERigVMGraphNotifType InNotifType,
    UObject* InSubject
)

Submits an event to the graph for broadcasting.

Public function

FRigVMGraphM...

 

OnModified()

The Modified event used to subscribe to changes happening within the Graph.

Public function

bool

 

OpenUndoBracket

(
    const FString& InTitle
)

Opens an undo bracket / scoped transaction for a series of actions to be performed as one step on the Undo stack.

Public function

int32

 

ReattachLinksToPinObjects

(
    bool bFollowCoreRedirectors
)

Public function

bool

 

Redo()

Re-does the last action on the stack.

Public function

void

 

RefreshVariableNode

(
    const FName& InNodeName,
    const FName& InVariableName,
    const FString& InCPPType,
    UObject* InCPPTypeObject,
    bool bUndo
)

Refreshes the variable node with the new data.

Public function

bool

 

RemoveArrayPin

(
    const FString& InArrayElementPinPa...,
    bool bUndo
)

Removes an array element pin from an array pin. This causes a PinArraySizeChanged modified event.

Public function

bool

 

RemoveNode

(
    URigVMNode* InNode,
    bool bUndo,
    bool bRecursive
)

Removes a node from the graph This causes a NodeRemoved modified event.

Public function

bool

 

RemoveNodeByName

(
    const FName& InNodeName,
    bool bUndo,
    bool bRecursive
)

Removes a node from the graph given the node's name. This causes a NodeRemoved modified event.

Public function

void

 

RemoveStaleNodes()

Removes nodes which went stale.

Public function

void

 

RemoveVariableNodes

(
    const FName& InVarName,
    bool bUndo
)

Removes all nodes related to a given variable.

Public function

bool

 

RenameParameter

(
    const FName& InOldName,
    const FName& InNewName,
    bool bUndo
)

Renames a parameter in the graph. This causes a ParameterRenamed modified event.

Public function

bool

 

RenameVariable

(
    const FName& InOldName,
    const FName& InNewName,
    bool bUndo
)

Renames a variable in the graph. This causes a VariableRenamed modified event.

Public function

void

 

RenameVariableNodes

(
    const FName& InOldVarName,
    const FName& InNewVarName,
    bool bUndo
)

Renames the variable name in all relevant nodes.

Public function

URigVMVariab...

 

ReplaceParameterNodeWithVariable

(
    const FName& InNodeName,
    const FName& InVariableName,
    const FString& InCPPType,
    UObject* InCPPTypeObject,
    bool bUndo
)

Refreshes the variable node with the new data.

Public function

void

 

RepopulatePinsOnNode

(
    URigVMNode* InNode
)

Public function

void

 

ResendAllNotifications()

Resends all notifications.

Public function

bool

 

ResetPinDefaultValue

(
    const FString& InPinPath,
    bool bUndo
)

Resets the default value of a pin given its pinpath.

Public function

bool

 

SelectNode

(
    URigVMNode* InNode,
    bool bSelect,
    bool bUndo
)

Selects a single node in the graph. This causes a NodeSelected / NodeDeselected modified event.

Public function

bool

 

SelectNodeByName

(
    const FName& InNodeName,
    bool bSelect,
    bool bUndo
)

Selects a single node in the graph by name.

Public function

bool

 

SetArrayPinSize

(
    const FString& InArrayPinPath,
    int32 InSize,
    const FString& InDefaultValue,
    bool bUndo
)

Sets the size of the array pin This causes a PinArraySizeChanged modified event.

Public function

bool

 

SetCommentText

(
    URigVMNode* InNode,
    const FString& InCommentText,
    bool bUndo
)

Sets the comment text of a comment node in the graph.

Public function

bool

 

SetCommentTextByName

(
    const FName& InNodeName,
    const FString& InCommentText,
    bool bUndo
)

Sets the comment text of a comment node in the graph by name.

Public function

void

 

SetExecuteContextStruct

(
    UStruct* InExecuteContextStruc...
)

Sets the execute context struct type to use.

Public function

void

 

SetGraph

(
    URigVMGraph* InGraph
)

Sets the currently edited Graph of this controller. This causes a GraphChanged modified event.

Public function

bool

 

SetNodeColor

(
    URigVMNode* InNode,
    const FLinearColor& InColor,
    bool bUndo,
    bool bMergeUndoAction
)

Sets the color of a node in the graph. This causes a NodeColorChanged modified event.

Public function

bool

 

SetNodeColorByName

(
    const FName& InNodeName,
    const FLinearColor& InColor,
    bool bUndo,
    bool bMergeUndoAction
)

Sets the color of a node in the graph by name. This causes a NodeColorChanged modified event.

Public function

bool

 

SetNodePosition

(
    URigVMNode* InNode,
    const FVector2D& InPosition,
    bool bUndo,
    bool bMergeUndoAction
)

Sets the position of a node in the graph. This causes a NodePositionChanged modified event.

Public function

bool

 

SetNodePositionByName

(
    const FName& InNodeName,
    const FVector2D& InPosition,
    bool bUndo,
    bool bMergeUndoAction
)

Sets the position of a node in the graph by name. This causes a NodePositionChanged modified event.

Public function

bool

 

SetNodeSelection

(
    const TArray< FName >& InNodeNames,
    bool bUndo
)

Selects the nodes given the selection This might cause several NodeDeselected modified event.

Public function

bool

 

SetNodeSize

(
    URigVMNode* InNode,
    const FVector2D& InSize,
    bool bUndo,
    bool bMergeUndoAction
)

Sets the size of a node in the graph. This causes a NodeSizeChanged modified event.

Public function

bool

 

SetNodeSizeByName

(
    const FName& InNodeName,
    const FVector2D& InSize,
    bool bUndo,
    bool bMergeUndoAction
)

Sets the size of a node in the graph by name. This causes a NodeSizeChanged modified event.

Public function

bool

 

SetPinDefaultValue

(
    const FString& InPinPath,
    const FString& InDefaultValue,
    bool bResizeArrays,
    bool bUndo,
    bool bMergeUndoAction
)

Sets the default value of a pin given its pinpath.

Public function

bool

 

SetPinExpansion

(
    const FString& InPinPath,
    bool bIsExpanded,
    bool bUndo
)

Sets the pin to be expanded or not This causes a PinExpansionChanged modified event.

Public function

bool

 

SetPinIsWatched

(
    const FString& InPinPath,
    bool bIsWatched,
    bool bUndo
)

Sets the pin to be watched (or not) This causes a PinWatchedChanged modified event.

Public function

bool

 

SetRerouteCompactness

(
    URigVMNode* InNode,
    bool bShowAsFullNode,
    bool bUndo
)

Sets the compactness of a reroute node in the graph.

Public function

bool

 

SetRerouteCompactnessByName

(
    const FName& InNodeName,
    bool bShowAsFullNode,
    bool bUndo
)

Sets the compactness of a reroute node in the graph by name.

Public function Const

bool

 

ShouldRedirectPin

(
    const FString& InOldPinPath,
    FString& InOutNewPinPath
)

Public function Const

bool

 

ShouldRedirectPin

(
    UScriptStruct* InOwningStruct,
    const FString& InOldRelativePinPat...,
    FString& InOutNewRelativePinPath
)

Public function

bool

 

Undo()

Un-does the last action on the stack.

Constants

Name

Description

PinPathCoreRedirectors

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss