unreal.RigVMController

class unreal.RigVMController(outer=None, name='None')

Bases: unreal.Object

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.

C++ Source:

  • Module: RigVMDeveloper

  • File: RigVMController.h

Editor Properties: (see get_editor_property/set_editor_property)

  • modified_event (RigVMGraphModifiedDynamicEvent): [Read-Write] Modified Event Dynamic

add_array_pin(array_pin_path, default_value='', undo=True)str

Adds an array element pin to the end of an array pin. This causes a PinArraySizeChanged modified event.

Parameters
  • array_pin_path (str) –

  • default_value (str) –

  • undo (bool) –

Returns

Return type

str

add_branch_node(position=[0.0, 0.0], node_name='', undo=True)RigVMBranchNode

Adds a branch node to the graph. Branch nodes can be used to split the execution of into multiple branches, allowing to drive behavior by logic.

Parameters
Returns

Return type

RigVMBranchNode

add_comment_node(comment_text, position=[0.0, 0.0], size=[400.0, 300.0], color=[0.0, 0.0, 0.0, 0.0], node_name='', undo=True)RigVMCommentNode

Adds a Comment Node to the edited Graph. Comments can be used to annotate the Graph. This causes a NodeAdded modified event.

Parameters
Returns

Return type

RigVMCommentNode

add_enum_node(cpp_type_object_path, position=[0.0, 0.0], node_name='', undo=True)RigVMEnumNode

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

Parameters
Returns

Return type

RigVMEnumNode

add_free_reroute_node(show_as_full_node, cpp_type, cpp_type_object_path, is_constant, custom_widget_name, default_value, position=[0.0, 0.0], node_name='', undo=True)RigVMRerouteNode

Adds a free Reroute Node

Parameters
  • show_as_full_node (bool) –

  • cpp_type (str) –

  • cpp_type_object_path (Name) –

  • is_constant (bool) –

  • custom_widget_name (Name) –

  • default_value (str) –

  • position (Vector2D) –

  • node_name (str) –

  • undo (bool) –

Returns

Return type

RigVMRerouteNode

add_if_node(cpp_type, cpp_type_object_path, position=[0.0, 0.0], node_name='', undo=True)RigVMIfNode

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

Parameters
  • cpp_type (str) –

  • cpp_type_object_path (Name) –

  • position (Vector2D) –

  • node_name (str) –

  • undo (bool) –

Returns

Return type

RigVMIfNode

add_injected_node(pin_path, as_input, script_struct, method_name, input_pin_name, output_pin_name, node_name='', undo=True)RigVMInjectionInfo

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

Parameters
Returns

Return type

RigVMInjectionInfo

add_injected_node_from_struct_path(pin_path, as_input, script_struct_path, method_name, input_pin_name, output_pin_name, node_name='', undo=True)RigVMInjectionInfo

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

Parameters
  • pin_path (str) –

  • as_input (bool) –

  • script_struct_path (str) –

  • method_name (Name) –

  • input_pin_name (Name) –

  • output_pin_name (Name) –

  • node_name (str) –

  • undo (bool) –

Returns

Return type

RigVMInjectionInfo

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

Parameters
  • output_pin_path (str) –

  • input_pin_path (str) –

  • undo (bool) –

Returns

Return type

bool

add_parameter_node(parameter_name, cpp_type, cpp_type_object, is_input, default_value, position=[0.0, 0.0], node_name='', undo=True)RigVMParameterNode

Adds a Parameter Node to the edited Graph. Parameters represent input or output arguments to the Graph / Function. Input Parameters are constant values / literals. This causes a NodeAdded modified event.

Parameters
  • parameter_name (Name) –

  • cpp_type (str) –

  • cpp_type_object (Object) –

  • is_input (bool) –

  • default_value (str) –

  • position (Vector2D) –

  • node_name (str) –

  • undo (bool) –

Returns

Return type

RigVMParameterNode

add_parameter_node_from_object_path(parameter_name, cpp_type, cpp_type_object_path, is_input, default_value, position=[0.0, 0.0], node_name='', undo=True)RigVMParameterNode

Adds a Parameter Node to the edited Graph given a struct object path name. Parameters represent input or output arguments to the Graph / Function. Input Parameters are constant values / literals. This causes a NodeAdded modified event.

Parameters
  • parameter_name (Name) –

  • cpp_type (str) –

  • cpp_type_object_path (str) –

  • is_input (bool) –

  • default_value (str) –

  • position (Vector2D) –

  • node_name (str) –

  • undo (bool) –

Returns

Return type

RigVMParameterNode

add_prototype_node(notation, position=[0.0, 0.0], node_name='', undo=True)RigVMPrototypeNode

Adds a prototype node to the graph.

Parameters
Returns

Return type

RigVMPrototypeNode

Adds a Reroute Node on an existing Link to the edited Graph. Reroute Nodes can be used to visually improve the data flow, they don’t require any additional memory though and are purely cosmetic. This causes a NodeAdded modified event.

Parameters
Returns

Return type

RigVMRerouteNode

Adds a Reroute Node on an existing Link to the edited Graph given the Link’s string representation. Reroute Nodes can be used to visually improve the data flow, they don’t require any additional memory though and are purely cosmetic. This causes a NodeAdded modified event.

Parameters
  • link_pin_path_representation (str) –

  • show_as_full_node (bool) –

  • position (Vector2D) –

  • node_name (str) –

  • undo (bool) –

Returns

Return type

RigVMRerouteNode

add_reroute_node_on_pin(pin_path, as_input, show_as_full_node, position=[0.0, 0.0], node_name='', undo=True)RigVMRerouteNode

Adds a Reroute Node on an existing Pin to the editor Graph. Reroute Nodes can be used to visually improve the data flow, they don’t require any additional memory though and are purely cosmetic. This causes a NodeAdded modified event.

Parameters
Returns

Return type

RigVMRerouteNode

add_select_node(cpp_type, cpp_type_object_path, position=[0.0, 0.0], node_name='', undo=True)RigVMSelectNode

Adds a select node to the graph. Select nodes can be used to pick between multiple values based on an index.

Parameters
  • cpp_type (str) –

  • cpp_type_object_path (Name) –

  • position (Vector2D) –

  • node_name (str) –

  • undo (bool) –

Returns

Return type

RigVMSelectNode

add_struct_node(script_struct, method_name, position=[0.0, 0.0], node_name='', undo=True)RigVMStructNode

Adds a Function / Struct Node to the edited Graph. StructNode represent a RIGVM_METHOD declaration on a USTRUCT. This causes a NodeAdded modified event.

Parameters
Returns

Return type

RigVMStructNode

add_struct_node_from_struct_path(script_struct_path, method_name, position=[0.0, 0.0], node_name='', undo=True)RigVMStructNode

Adds a Function / Struct Node to the edited Graph given its struct object path name. StructNode represent a RIGVM_METHOD declaration on a USTRUCT. This causes a NodeAdded modified event.

Parameters
  • script_struct_path (str) –

  • method_name (Name) –

  • position (Vector2D) –

  • node_name (str) –

  • undo (bool) –

Returns

Return type

RigVMStructNode

add_variable_node(variable_name, cpp_type, cpp_type_object, is_getter, default_value, position=[0.0, 0.0], node_name='', undo=True)RigVMVariableNode

Adds a Variable Node to the edited Graph. Variables represent local work state for the function and can be read from and written to. This causes a NodeAdded modified event.

Parameters
  • variable_name (Name) –

  • cpp_type (str) –

  • cpp_type_object (Object) –

  • is_getter (bool) –

  • default_value (str) –

  • position (Vector2D) –

  • node_name (str) –

  • undo (bool) –

Returns

Return type

RigVMVariableNode

add_variable_node_from_object_path(variable_name, cpp_type, cpp_type_object_path, is_getter, default_value, position=[0.0, 0.0], node_name='', undo=True)RigVMVariableNode

Adds a Variable Node to the edited Graph given a struct object path name. Variables represent local work state for the function and can be read from (bIsGetter == true) or written to (bIsGetter == false). This causes a NodeAdded modified event.

Parameters
  • variable_name (Name) –

  • cpp_type (str) –

  • cpp_type_object_path (str) –

  • is_getter (bool) –

  • default_value (str) –

  • position (Vector2D) –

  • node_name (str) –

  • undo (bool) –

Returns

Return type

RigVMVariableNode

Removes all links on a given pin from the graph. This might cause multiple LinkRemoved modified event.

Parameters
  • pin_path (str) –

  • as_input (bool) –

  • undo (bool) –

Returns

Return type

bool

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

Parameters
  • output_pin_path (str) –

  • input_pin_path (str) –

  • undo (bool) –

Returns

Return type

bool

can_import_nodes_from_text(text)bool

Exports the given nodes as text

Parameters

text (str) –

Returns

Return type

bool

cancel_undo_bracket()bool

Cancels an undo bracket / scoped transaction. This is primarily useful for Python. This causes a UndoBracketCanceled modified event.

Returns

Return type

bool

change_variable_nodes_type(var_name, cpp_type, cpp_type_object, undo)None

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

Parameters
  • var_name (Name) –

  • cpp_type (str) –

  • cpp_type_object (Object) –

  • undo (bool) –

clear_array_pin(array_pin_path, undo=True)bool

Removes all (but one) array element pin from an array pin. This causes a PinArraySizeChanged modified event.

Parameters
  • array_pin_path (str) –

  • undo (bool) –

Returns

Return type

bool

clear_node_selection(undo=True)bool

Deselects all currently selected nodes in the graph. This might cause several NodeDeselected modified event.

Parameters

undo (bool) –

Returns

Return type

bool

close_undo_bracket()bool

Closes an undo bracket / scoped transaction. This is primarily useful for Python. This causes a UndoBracketClosed modified event.

Returns

Return type

bool

duplicate_array_pin(array_element_pin_path, undo=True)str

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

Parameters
  • array_element_pin_path (str) –

  • undo (bool) –

Returns

Return type

str

eject_node_from_pin(pin_path, undo=True)RigVMNode

Ejects the last injected node on a pin

Parameters
  • pin_path (str) –

  • undo (bool) –

Returns

Return type

RigVMNode

enable_reporting(enabled=True)None

Enables or disables the error reporting of this Controller.

Parameters

enabled (bool) –

export_nodes_to_text(node_names)str

Exports the given nodes as text

Parameters

node_names (Array(Name)) –

Returns

Return type

str

export_selected_nodes_to_text()str

Exports the selected nodes as text

Returns

Return type

str

get_graph()RigVMGraph

Returns the currently edited Graph of this controller.

Returns

Return type

RigVMGraph

get_pin_default_value(pin_path)str

Returns the default value of a pin given its pinpath.

Parameters

pin_path (str) –

Returns

Return type

str

import_nodes_from_text(text, undo=True)

Exports the given nodes as text

Parameters
Returns

Return type

Array(Name)

insert_array_pin(array_pin_path, index=- 1, default_value='', undo=True)str

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

Parameters
  • array_pin_path (str) –

  • index (int32) –

  • default_value (str) –

  • undo (bool) –

Returns

Return type

str

is_reporting_enabled()bool

Returns true if reporting is enabled

Returns

Return type

bool

property modified_event

[Read-Only] Modified Event Dynamic

Type

(RigVMGraphModifiedDynamicEvent)

open_undo_bracket(title)bool

Opens an undo bracket / scoped transaction for a series of actions to be performed as one step on the Undo stack. This is primarily useful for Python. This causes a UndoBracketOpened modified event.

Parameters

title (str) –

Returns

Return type

bool

redo()bool

Re-does the last action on the stack. Note: This should really only be used for unit tests, use the GEditor’s main Undo method instead.

Returns

Return type

bool

refresh_variable_node(node_name, variable_name, cpp_type, cpp_type_object, undo)None

Refreshes the variable node with the new data

Parameters
  • node_name (Name) –

  • variable_name (Name) –

  • cpp_type (str) –

  • cpp_type_object (Object) –

  • undo (bool) –

remove_array_pin(array_element_pin_path, undo=True)bool

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

Parameters
  • array_element_pin_path (str) –

  • undo (bool) –

Returns

Return type

bool

remove_node(node, undo=True, recursive=False)bool

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

Parameters
Returns

Return type

bool

remove_node_by_name(node_name, undo=True, recursive=False)bool

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

Parameters
Returns

Return type

bool

remove_variable_nodes(var_name, undo)None

Removes all nodes related to a given variable

Parameters
rename_parameter(old_name, new_name, undo=True)bool

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

Parameters
Returns

Return type

bool

rename_variable(old_name, new_name, undo=True)bool

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

Parameters
Returns

Return type

bool

rename_variable_nodes(old_var_name, new_var_name, undo)None

Renames the variable name in all relevant nodes

Parameters
  • old_var_name (Name) –

  • new_var_name (Name) –

  • undo (bool) –

replace_parameter_node_with_variable(node_name, variable_name, cpp_type, cpp_type_object, undo)RigVMVariableNode

Refreshes the variable node with the new data

Parameters
  • node_name (Name) –

  • variable_name (Name) –

  • cpp_type (str) –

  • cpp_type_object (Object) –

  • undo (bool) –

Returns

Return type

RigVMVariableNode

reset_pin_default_value(pin_path, undo=True)bool

Resets the default value of a pin given its pinpath. This causes a PinDefaultValueChanged modified event.

Parameters
  • pin_path (str) –

  • undo (bool) –

Returns

Return type

bool

select_node(node, select=True, undo=True)bool

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

Parameters
Returns

Return type

bool

select_node_by_name(node_name, select=True, undo=True)bool

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

Parameters
Returns

Return type

bool

set_array_pin_size(array_pin_path, size, default_value='', undo=True)bool

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

Parameters
  • array_pin_path (str) –

  • size (int32) –

  • default_value (str) –

  • undo (bool) –

Returns

Return type

bool

set_comment_text(node, comment_text, undo=True)bool

Sets the comment text of a comment node in the graph. This causes a CommentTextChanged modified event.

Parameters
Returns

Return type

bool

set_comment_text_by_name(node_name, comment_text, undo=True)bool

Sets the comment text of a comment node in the graph by name. This causes a CommentTextChanged modified event.

Parameters
  • node_name (Name) –

  • comment_text (str) –

  • undo (bool) –

Returns

Return type

bool

set_graph(graph)None

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

Parameters

graph (RigVMGraph) –

set_node_color(node, color, undo=True, merge_undo_action=False)bool

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

Parameters
Returns

Return type

bool

set_node_color_by_name(node_name, color, undo=True, merge_undo_action=False)bool

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

Parameters
Returns

Return type

bool

set_node_position(node, position, undo=True, merge_undo_action=False)bool

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

Parameters
Returns

Return type

bool

set_node_position_by_name(node_name, position, undo=True, merge_undo_action=False)bool

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

Parameters
Returns

Return type

bool

set_node_selection(node_names, undo=True)bool

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

Parameters
Returns

Return type

bool

set_node_size(node, size, undo=True, merge_undo_action=False)bool

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

Parameters
Returns

Return type

bool

set_node_size_by_name(node_name, size, undo=True, merge_undo_action=False)bool

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

Parameters
Returns

Return type

bool

set_pin_default_value(pin_path, default_value, resize_arrays=True, undo=True, merge_undo_action=False)bool

Sets the default value of a pin given its pinpath. This causes a PinDefaultValueChanged modified event.

Parameters
  • pin_path (str) –

  • default_value (str) –

  • resize_arrays (bool) –

  • undo (bool) –

  • merge_undo_action (bool) –

Returns

Return type

bool

set_pin_expansion(pin_path, is_expanded, undo=True)bool

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

Parameters
  • pin_path (str) –

  • is_expanded (bool) –

  • undo (bool) –

Returns

Return type

bool

set_pin_is_watched(pin_path, is_watched, undo=True)bool

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

Parameters
  • pin_path (str) –

  • is_watched (bool) –

  • undo (bool) –

Returns

Return type

bool

set_reroute_compactness(node, show_as_full_node, undo=True)bool

Sets the compactness of a reroute node in the graph. This causes a RerouteCompactnessChanged modified event.

Parameters
Returns

Return type

bool

set_reroute_compactness_by_name(node_name, show_as_full_node, undo=True)bool

Sets the compactness of a reroute node in the graph by name. This causes a RerouteCompactnessChanged modified event.

Parameters
  • node_name (Name) –

  • show_as_full_node (bool) –

  • undo (bool) –

Returns

Return type

bool

undo()bool

Un-does the last action on the stack. Note: This should really only be used for unit tests, use the GEditor’s main Undo method instead.

Returns

Return type

bool