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_node(op_code, cpp_type, cpp_type_object, position=[0.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) RigVMArrayNode ¶
Adds a Array Node to the edited Graph. This causes a NodeAdded modified event.
- Parameters
- Return type
- add_array_node_from_object_path(op_code, cpp_type, cpp_type_object_path, position=[0.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) RigVMArrayNode ¶
Adds a Array Node to the edited Graph given a struct object path name. This causes a NodeAdded modified event.
- Parameters
- Return type
- add_array_pin(array_pin_path, default_value='', setup_undo_redo=True, print_python_command=False) str ¶
Adds an array element pin to the end of an array pin. This causes a PinArraySizeChanged modified event.
- add_branch_node(position=[0.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) 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
- Return type
- add_comment_node(comment_text, position=[0.000000, 0.000000], size=[400.000000, 300.000000], color=[0.000000, 0.000000, 0.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) RigVMCommentNode ¶
Adds a Comment Node to the edited Graph. Comments can be used to annotate the Graph. This causes a NodeAdded modified event.
- Parameters
- Return type
- add_enum_node(cpp_type_object_path, position=[0.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) RigVMEnumNode ¶
Adds an enum node to the graph Enum nodes can be used to represent constant enum values within the graph
- add_exposed_pin(pin_name, direction, cpp_type, cpp_type_object_path, default_value, setup_undo_redo=True, print_python_command=False) Name ¶
Adds an exposed pin to the graph controlled by this
- add_free_reroute_node(show_as_full_node, cpp_type, cpp_type_object_path, is_constant, custom_widget_name, default_value, position=[0.000000, 0.000000], node_name='', setup_undo_redo=True) RigVMRerouteNode ¶
Adds a free Reroute Node
- add_function_reference_node(function_definition, node_position=[0.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) RigVMFunctionReferenceNode ¶
Adds a function reference / invocation to the graph
- Parameters
function_definition (RigVMLibraryNode) –
node_position (Vector2D) –
node_name (str) –
setup_undo_redo (bool) –
print_python_command (bool) –
- Return type
- add_function_to_library(function_name, mutable, node_position=[0.000000, 0.000000], setup_undo_redo=True, print_python_command=False) RigVMLibraryNode ¶
Adds a function definition to a function library graph
- add_if_node(cpp_type, cpp_type_object_path, position=[0.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) RigVMIfNode ¶
Adds an if node to the graph. If nodes can be used to pick between two values based on a condition.
- add_if_node_from_struct(script_struct, position=[0.000000, 0.000000], node_name='', setup_undo_redo=True) RigVMIfNode ¶
Add if Node from Struct
- Parameters
script_struct (ScriptStruct) –
position (Vector2D) –
node_name (str) –
setup_undo_redo (bool) –
- Return type
- add_injected_node(pin_path, as_input, script_struct, method_name, input_pin_name, output_pin_name, node_name='', setup_undo_redo=True, print_python_command=False) RigVMInjectionInfo ¶
Adds a Function / Struct Node to the edited Graph as an injected node UnitNode represent a RIGVM_METHOD declaration on a USTRUCT. This causes a NodeAdded modified event.
- Parameters
- 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='', setup_undo_redo=True) RigVMInjectionInfo ¶
Adds a Function / Struct Node to the edited Graph as an injected node UnitNode represent a RIGVM_METHOD declaration on a USTRUCT. This causes a NodeAdded modified event.
- add_link(output_pin_path, input_pin_path, setup_undo_redo=True, print_python_command=False) bool ¶
Adds a link to the graph. This causes a LinkAdded modified event.
- add_local_variable(variable_name, cpp_type, cpp_type_object, default_value, setup_undo_redo=True, print_python_command=False) RigVMGraphVariableDescription ¶
Add a local variable to the graph
- add_local_variable_from_object_path(variable_name, cpp_type, cpp_type_object_path, default_value, setup_undo_redo=True) RigVMGraphVariableDescription ¶
Add a local variable to the graph given a struct object path name.
- add_parameter_node(parameter_name, cpp_type, cpp_type_object, is_input, default_value, position=[0.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) 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.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) 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.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) RigVMPrototypeNode ¶
Adds a prototype node to the graph.
- add_reroute_node_on_link(link, show_as_full_node, position=[0.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) 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.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) 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.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) 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.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) RigVMSelectNode ¶
Adds a select node to the graph. Select nodes can be used to pick between multiple values based on an index.
- add_select_node_from_struct(script_struct, position=[0.000000, 0.000000], node_name='', setup_undo_redo=True) RigVMSelectNode ¶
Add Select Node from Struct
- Parameters
script_struct (ScriptStruct) –
position (Vector2D) –
node_name (str) –
setup_undo_redo (bool) –
- Return type
- add_unit_node(script_struct, method_name='Execute', position=[0.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) RigVMUnitNode ¶
Adds a Function / Struct Node to the edited Graph. UnitNode represent a RIGVM_METHOD declaration on a USTRUCT. This causes a NodeAdded modified event.
- Parameters
- Return type
- add_unit_node_from_struct_path(script_struct_path, method_name='Execute', position=[0.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) RigVMUnitNode ¶
Adds a Function / Struct Node to the edited Graph given its struct object path name. UnitNode 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.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) 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.000000, 0.000000], node_name='', setup_undo_redo=True, print_python_command=False) 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.
- bind_pin_to_variable(pin_path, new_bound_variable_path, setup_undo_redo=True, print_python_command=False) bool ¶
Binds a pin to a variable (or removes the binding given NAME_None) This causes a PinBoundVariableChanged modified event.
- break_all_links(pin_path, as_input=True, setup_undo_redo=True, print_python_command=False) 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, setup_undo_redo=True, print_python_command=False) 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.
- Return type
- change_exposed_pin_type(pin_name, cpp_type, cpp_type_object_path, setup_undo_redo, setup_orphan_pins=True, print_python_command=False) bool or None ¶
Changes the type of an exposed pin in the graph controlled by this
- clear_array_pin(array_pin_path, setup_undo_redo=True, print_python_command=False) bool ¶
Removes all (but one) array element pin from an array pin. This causes a PinArraySizeChanged modified event.
- clear_node_selection(setup_undo_redo=True, print_python_command=False) 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.
- Return type
- collapse_nodes(node_names, collapse_node_name='', setup_undo_redo=True, print_python_command=False) RigVMCollapseNode ¶
Turns a series of nodes into a Collapse node
- duplicate_array_pin(array_element_pin_path, setup_undo_redo=True, print_python_command=False) str ¶
Duplicates an array element pin. This causes a PinArraySizeChanged modified event.
- eject_node_from_pin(pin_path, setup_undo_redo=True, print_python_command=False) RigVMNode ¶
Ejects the last injected node on a pin
- enable_reporting(enabled=True) None ¶
Enables or disables the error reporting of this Controller.
- Parameters
enabled (bool) –
- expand_library_node(node_name, setup_undo_redo=True, print_python_command=False)¶
Turns a library node into its contained nodes
- get_graph() RigVMGraph ¶
Returns the currently edited Graph of this controller.
- Return type
- get_top_level_graph() RigVMGraph ¶
Returns the top level graph
- Return type
- import_nodes_from_text(text, setup_undo_redo=True, print_python_commands=False)¶
Exports the given nodes as text
- insert_array_pin(array_pin_path, index=- 1, default_value='', setup_undo_redo=True, print_python_command=False) str ¶
Inserts an array element pin into an array pin. This causes a PinArraySizeChanged modified event.
- localize_function(function_definition, localize_dependent_private_functions=True, setup_undo_redo=True, print_python_command=False) RigVMLibraryNode ¶
Copies a function declaration into this graph’s local function library
- Parameters
function_definition (RigVMLibraryNode) –
localize_dependent_private_functions (bool) –
setup_undo_redo (bool) –
print_python_command (bool) –
- Return type
- localize_functions(function_definitions, localize_dependent_private_functions=True, setup_undo_redo=True, print_python_command=False)¶
Copies a series of function declaratioms into this graph’s local function library
- Parameters
function_definitions (Array(RigVMLibraryNode)) –
localize_dependent_private_functions (bool) –
setup_undo_redo (bool) –
print_python_command (bool) –
- Return type
- make_bindings_from_variable_node(node_name, setup_undo_redo=True, print_python_command=False) bool ¶
Turns a variable node into one or more bindings
- make_variable_node_from_binding(pin_path, node_position=[0.000000, 0.000000], setup_undo_redo=True, print_python_command=False) bool ¶
Turns a binding to a variable node
- property modified_event¶
[Read-Only] Modified Event Dynamic
- on_external_variable_removed(var_name, setup_undo_redo) None ¶
Removes all nodes related to a given variable
- on_external_variable_renamed(old_var_name, new_var_name, setup_undo_redo) None ¶
Renames the variable name in all relevant nodes
- on_external_variable_type_changed(var_name, cpp_type, cpp_type_object, setup_undo_redo) None ¶
Changes the data type of all nodes matching a given variable name
- on_external_variable_type_changed_from_object_path(var_name, cpp_type, cpp_type_object_path, setup_undo_redo) None ¶
On External Variable Type Changed from Object Path
- 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.
- pop_graph(setup_undo_redo=True) RigVMGraph ¶
Pops the last graph off the stack This causes a GraphChanged modified event.
- Parameters
setup_undo_redo (bool) –
- Return type
- promote_collapse_node_to_function_reference_node(node_name, setup_undo_redo=True, print_python_command=False, existing_function_definition_path='') Name ¶
Turns a collapse node into a function node
- promote_function_reference_node_to_collapse_node(node_name, setup_undo_redo=True, print_python_command=False, remove_function_definition=False) Name ¶
Turns a collapse node into a function node
- promote_pin_to_variable(pin_path, create_variable_node, node_position=[0.000000, 0.000000], setup_undo_redo=True, print_python_command=False) bool ¶
Promotes a pin to a variable
- push_graph(graph, setup_undo_redo=True) None ¶
Pushes a new graph to the stack This causes a GraphChanged modified event.
- Parameters
graph (RigVMGraph) –
setup_undo_redo (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.
- Return type
- refresh_variable_node(node_name, variable_name, cpp_type, cpp_type_object, setup_undo_redo, setup_orphan_pins=True) None ¶
Refreshes the variable node with the new data
- remove_array_pin(array_element_pin_path, setup_undo_redo=True, print_python_command=False) bool ¶
Removes an array element pin from an array pin. This causes a PinArraySizeChanged modified event.
- remove_exposed_pin(pin_name, setup_undo_redo=True, print_python_command=False) bool ¶
Removes an exposed pin from the graph controlled by this
- remove_function_from_library(function_name, setup_undo_redo=True) bool ¶
Removes a function from a function library graph
- remove_injected_node(pin_path, as_input, setup_undo_redo=True, print_python_command=False) bool ¶
Removes an injected node This causes a NodeRemoved modified event.
- remove_local_variable(variable_name, setup_undo_redo=True, print_python_command=False) bool ¶
Remove a local variable from the graph
- remove_node(node, setup_undo_redo=True, recursive=False, print_python_command=False, relink_pins=False) bool ¶
Removes a node from the graph This causes a NodeRemoved modified event.
- remove_node_by_name(node_name, setup_undo_redo=True, recursive=False, print_python_command=False, relink_pins=False) bool ¶
Removes a node from the graph given the node’s name. This causes a NodeRemoved modified event.
- rename_exposed_pin(old_pin_name, new_pin_name, setup_undo_redo=True, print_python_command=False) bool ¶
Renames an exposed pin in the graph controlled by this
- rename_function(old_function_name, new_function_name, setup_undo_redo=True) bool ¶
Renames a function in the function library
- rename_local_variable(variable_name, new_variable_name, setup_undo_redo=True, print_python_command=False) bool ¶
Rename a local variable from the graph
- rename_node(node, new_name, setup_undo_redo=True, print_python_command=False) bool ¶
Renames a node in the graph This causes a NodeRenamed modified event.
- rename_parameter(old_name, new_name, setup_undo_redo=True) bool ¶
Renames a parameter in the graph. This causes a ParameterRenamed modified event.
- rename_variable(old_name, new_name, setup_undo_redo=True) bool ¶
Renames a variable in the graph. This causes a VariableRenamed modified event.
- replace_parameter_node_with_variable(node_name, variable_name, cpp_type, cpp_type_object, setup_undo_redo) RigVMVariableNode ¶
Refreshes the variable node with the new data
- reset_pin_default_value(pin_path, setup_undo_redo=True, print_python_command=False) bool ¶
Resets the default value of a pin given its pinpath. This causes a PinDefaultValueChanged modified event.
- select_node(node, select=True, setup_undo_redo=True, print_python_command=False) bool ¶
Selects a single node in the graph. This causes a NodeSelected / NodeDeselected modified event.
- select_node_by_name(node_name, select=True, setup_undo_redo=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='', setup_undo_redo=True, print_python_command=False) bool ¶
Sets the size of the array pin This causes a PinArraySizeChanged modified event.
- set_comment_text(node, comment_text, comment_font_size, comment_bubble_visible, comment_color_bubble, setup_undo_redo=True, print_python_command=False) bool ¶
Sets the comment text and properties of a comment node in the graph. This causes a CommentTextChanged modified event.
- set_comment_text_by_name(node_name, comment_text, comment_font_size, comment_bubble_visible, comment_color_bubble, setup_undo_redo=True, print_python_command=False) bool ¶
Sets the comment text and properties of a comment node in the graph by name. This causes a CommentTextChanged modified event.
- set_exposed_pin_index(pin_name, new_index, setup_undo_redo=True, print_python_command=False) bool ¶
Sets the index for an exposed pin. This can be used to move the pin up and down on the node.
- set_graph(graph) None ¶
Sets the currently edited Graph of this controller. This causes a GraphChanged modified event.
- Parameters
graph (RigVMGraph) –
- set_is_running_unit_test(is_running) None ¶
Helper function to disable a series of checks that can be ignored during a unit test
- Parameters
is_running (bool) –
- set_local_variable_default_value(variable_name, default_value, setup_undo_redo=True, print_python_command=False, notify=True) bool ¶
Set Local Variable Default Value
- set_local_variable_type(variable_name, cpp_type, cpp_type_object, setup_undo_redo=True, print_python_command=False) bool ¶
Sets the type of the local variable
- set_local_variable_type_from_object_path(variable_name, cpp_type, cpp_type_object_path, setup_undo_redo=True, print_python_command=False) bool ¶
Set Local Variable Type from Object Path
- set_node_category(node, category, setup_undo_redo=True, merge_undo_action=False, print_python_command=False) bool ¶
Sets the category of a node in the graph. This causes a NodeCategoryChanged modified event.
- set_node_category_by_name(node_name, category, setup_undo_redo=True, merge_undo_action=False) bool ¶
Sets the category of a node in the graph. This causes a NodeCategoryChanged modified event.
- set_node_color(node, color, setup_undo_redo=True, merge_undo_action=False, print_python_command=False) bool ¶
Sets the color of a node in the graph. This causes a NodeColorChanged modified event.
- set_node_color_by_name(node_name, color, setup_undo_redo=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) –
setup_undo_redo (bool) –
merge_undo_action (bool) –
- Return type
- set_node_description(node, description, setup_undo_redo=True, merge_undo_action=False, print_python_command=False) bool ¶
Sets the function description of a node in the graph. This causes a NodeDescriptionChanged modified event.
- set_node_description_by_name(node_name, description, setup_undo_redo=True, merge_undo_action=False) bool ¶
Sets the keywords of a node in the graph. This causes a NodeDescriptionChanged modified event.
- set_node_keywords(node, keywords, setup_undo_redo=True, merge_undo_action=False, print_python_command=False) bool ¶
Sets the keywords of a node in the graph. This causes a NodeKeywordsChanged modified event.
- set_node_keywords_by_name(node_name, keywords, setup_undo_redo=True, merge_undo_action=False) bool ¶
Sets the keywords of a node in the graph. This causes a NodeKeywordsChanged modified event.
- set_node_position(node, position, setup_undo_redo=True, merge_undo_action=False, print_python_command=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, setup_undo_redo=True, merge_undo_action=False, print_python_command=False) bool ¶
Sets the position of a node in the graph by name. This causes a NodePositionChanged modified event.
- set_node_selection(node_names, setup_undo_redo=True, print_python_command=False) bool ¶
Selects the nodes given the selection This might cause several NodeDeselected modified event.
- set_node_size(node, size, setup_undo_redo=True, merge_undo_action=False, print_python_command=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, setup_undo_redo=True, merge_undo_action=False, print_python_command=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, setup_undo_redo=True, merge_undo_action=False, print_python_command=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, setup_undo_redo=True, print_python_command=False) bool ¶
Sets the pin to be expanded or not This causes a PinExpansionChanged modified event.
- set_pin_is_watched(pin_path, is_watched, setup_undo_redo=True) bool ¶
Sets the pin to be watched (or not) This causes a PinWatchedChanged modified event.
- set_remapped_variable(function_ref_node, inner_variable_name, outer_variable_name, setup_undo_redo=True) bool ¶
Sets the remapped variable on a function reference node
- Parameters
function_ref_node (RigVMFunctionReferenceNode) –
inner_variable_name (Name) –
outer_variable_name (Name) –
setup_undo_redo (bool) –
- Return type
- set_reroute_compactness(node, show_as_full_node, setup_undo_redo=True, print_python_command=False) bool ¶
Sets the compactness of a reroute node in the graph. This causes a RerouteCompactnessChanged modified event.
- set_reroute_compactness_by_name(node_name, show_as_full_node, setup_undo_redo=True) bool ¶
Sets the compactness of a reroute node in the graph by name. This causes a RerouteCompactnessChanged modified event.