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.
- 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
- 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
- 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
- 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
- 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.
- 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
- 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.
- add_link(output_pin_path, input_pin_path, undo=True) → bool¶
Adds a link to the graph. This causes a LinkAdded modified event.
- 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.
- 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.
- 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
- add_reroute_node_on_link(link, show_as_full_node, position=[0.0, 0.0], node_name='', undo=True) → RigVMRerouteNode¶
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.
- add_reroute_node_on_link_path(link_pin_path_representation, show_as_full_node, position=[0.0, 0.0], node_name='', undo=True) → 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.
- 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.
- 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.
- 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
script_struct (ScriptStruct) –
method_name (Name) –
position (Vector2D) –
node_name (str) –
undo (bool) –
- Returns
- Return type
- 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.
- 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.
- 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.
- break_all_links(pin_path, as_input=True, undo=True) → bool¶
Removes all links on a given pin from the graph. This might cause multiple LinkRemoved modified event.
- break_link(output_pin_path, input_pin_path, undo=True) → bool¶
Removes a link from the graph. This causes a LinkRemoved modified event.
- 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
- 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
- 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.
- clear_node_selection(undo=True) → bool¶
Deselects all currently selected nodes in the graph. This might cause several NodeDeselected modified event.
- 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
- duplicate_array_pin(array_element_pin_path, undo=True) → str¶
Duplicates an array element pin. This causes a PinArraySizeChanged modified event.
- enable_reporting(enabled=True) → None¶
Enables or disables the error reporting of this Controller.
- Parameters
enabled (bool) –
- get_graph() → RigVMGraph¶
Returns the currently edited Graph of this controller.
- Returns
- Return type
- import_nodes_from_text(text, undo=True)¶
Exports the given nodes as text
- 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.
- property modified_event¶
[Read-Only] Modified Event Dynamic
- 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.
- 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
- refresh_variable_node(node_name, variable_name, cpp_type, cpp_type_object, undo) → None¶
Refreshes the variable node with the new data
- 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.
- remove_node(node, undo=True, recursive=False) → bool¶
Removes a node from the graph This causes a NodeRemoved modified event.
- 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.
- rename_parameter(old_name, new_name, undo=True) → bool¶
Renames a parameter in the graph. This causes a ParameterRenamed modified event.
- rename_variable(old_name, new_name, undo=True) → bool¶
Renames a variable in the graph. This causes a VariableRenamed modified event.
- rename_variable_nodes(old_var_name, new_var_name, undo) → None¶
Renames the variable name in all relevant nodes
- replace_parameter_node_with_variable(node_name, variable_name, cpp_type, cpp_type_object, undo) → RigVMVariableNode¶
Refreshes the variable node with the new data
- 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.
- select_node(node, select=True, undo=True) → bool¶
Selects a single node in the graph. This causes a NodeSelected / NodeDeselected modified event.
- 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.
- 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.
- 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.
- 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.
- 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
node (RigVMNode) –
color (LinearColor) –
undo (bool) –
merge_undo_action (bool) –
- Returns
- Return type
- 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
node_name (Name) –
color (LinearColor) –
undo (bool) –
merge_undo_action (bool) –
- Returns
- Return type
- 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.
- 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.
- set_node_selection(node_names, undo=True) → bool¶
Selects the nodes given the selection This might cause several NodeDeselected modified event.
- 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.
- 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.
- 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.
- set_pin_expansion(pin_path, is_expanded, undo=True) → bool¶
Sets the pin to be expanded or not This causes a PinExpansionChanged modified event.
- 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.
- 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.