unreal.MovieGraphConfig¶
- class unreal.MovieGraphConfig(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
ObjectThis is the runtime representation of the UMoviePipelineEdGraph which contains the actual strongly typed graph network that is read by the MoviePipeline. There is an editor-only representation of this graph (UMoviePipelineEdGraph).
C++ Source:
Plugin: MovieRenderPipeline
Module: MovieRenderPipelineCore
File: MovieGraphConfig.h
- add_input(base_name='') MovieGraphInput¶
Adds a new input member to the graph. Returns the new input on success, else nullptr.
The default name of the input is “Input”. Optionally, InBaseName can be specified to add the input with a specific name. If the name “Input” (or the custom InBaseName) isn’t available, a numerical suffix will be added.
- Parameters:
base_name (Text)
- Return type:
- add_labeled_edge(from_node, from_pin_label, to_node, to_pin_label) bool¶
Add a connection in the graph between the given nodes and pin names. Pin name may be empty for basic nodes (if no name is displayed in the UI). Can be used for either input or output pins. Returns False if the pin could not be found, or the connection could not be made (type mismatches).
- Parameters:
from_node (MovieGraphNode)
from_pin_label (Name)
to_node (MovieGraphNode)
to_pin_label (Name)
- Return type:
- add_output(base_name='') MovieGraphOutput¶
Adds a new output member to the graph. Returns the new output on success, else nullptr.
The default name of the output is “Output”. Optionally, InBaseName can be specified to add the output with a specific name. If the name “Output” (or the custom InBaseName) isn’t available, a numerical suffix will be added.
- Parameters:
base_name (Text)
- Return type:
- add_variable(custom_base_name='None') MovieGraphVariable¶
Adds a new variable member with default values to the graph. The new variable will have a base name of “Variable” unless specified in InCustomBaseName. Returns the new variable on success, else nullptr.
- Parameters:
custom_base_name (Name)
- Return type:
- create_flattened_graph(context) -> (MovieGraphEvaluatedConfig, out_error=str)¶
Given a user-defined evaluation context, evaluate the graph and build a “flattened” list of settings for each branch discovered. If there was an error while evaluating the graph, nullptr will be returned and OutError will be populated with a description of the problem.
- Parameters:
context (MovieGraphTraversalContext)
- Returns:
out_error (str):
- Return type:
- create_node_by_class(class_) MovieGraphNode¶
Creates the given node type in this graph. Does not create any connections, and a node will not be considered during evaluation unless it is connected to other nodes in the graph.
- Parameters:
- Return type:
- delete_member(member_to_delete) bool¶
Remove the specified member (input, output, variable) from the graph.
- Parameters:
member_to_delete (MovieGraphMember)
- Return type:
- duplicate_variable(variable_to_duplicate) MovieGraphVariable¶
Duplicates the provided variable. Returns the new variable on success, else nullptr.
- Parameters:
variable_to_duplicate (MovieGraphVariable)
- Return type:
- get_all_contained_subgraphs() Set[MovieGraphConfig]¶
Get all subgraphs that this graph contains, recursively (ie, subgraphs of subgraphs are included, etc).
- Returns:
out_subgraphs (Set[MovieGraphConfig]):
- Return type:
- get_branch_names() Array[Name]¶
Returns an array of the branch names for the OutputNode on this Graph.
- get_downstream_branch_names(from_node, from_pin, stop_at_subgraph=False) Array[str]¶
Determines the name(s) of the branches downstream from FromNode, starting at FromPin. Optionally, subgraph nodes can halt graph traversal if bStopAtSubgraph is set to true.
- Parameters:
from_node (MovieGraphNode)
from_pin (MovieGraphPin)
stop_at_subgraph (bool)
- Return type:
- get_input_node() MovieGraphNode¶
Gets the automatically generated “Inputs” node in the Graph.
- Return type:
- get_inputs() Array[MovieGraphInput]¶
Gets all inputs that have been defined on the graph.
- Return type:
- get_node_for_branch(class_, branch_name, exact_match=False) MovieGraphNode¶
Finds a node (by type) for the given branch name (see GetBranchNames()). Returns the first result of that type found, even if there are multiple, following traversal order (ie: right to left). To prevent accidentally editing unrelated assets, does not dive into sub-graphs (but can continue traversal beyond them), so returned results should only exist in current asset. Does not contain the Input or Output nodes, see GetInputNode() and GetOutputNode().
- Parameters:
class (type(Class)) – The node class type to search for. Use UMovieGraphSettingNode to only include nodes that show up in the final evaluated graph (excludes nodes like the Branch node).
branch_name (Name) – The branch to search for these nodes on.
exact_match (bool) – Defaults false. If true, will not consider inherited classes of InClass. (ie: If requesting a base class and only child classes exist, they will not count when using exact matching).
- Returns:
First node found (if any) which are of the specified InClass type on the given branch.
- Return type:
- get_node_for_tag(script_tag, optional_class_filter=None, optional_branch_filter='None', exact_match=False) MovieGraphNode¶
Finds a node by ScriptTag field. THIS SEARCH IS CASE SENSITIVE. Returns the first result of that tag found, even if there are multiple, following traversal order (ie: right to left). If OptionalClassFilter is specified, only matches against nodes that have the right class type and contain the correct tag. To prevent accidentally editing unrelated assets, does not dive into sub-graphs (but can continue traversal beyond them), so returned results should only exist in current asset. Does not contain the Input or Output nodes, see GetInputNode() and GetOutputNode().
- Parameters:
script_tag (str) – Case sensitive name into the “Script Tags” property on Nodes
optional_class_filter (type(Class)) – Defaults None. If specified, will only return a node of this class that matches the tag. Use UMovieGraphSettingNode to only include nodes that show up in the final evaluated graph (excludes nodes like the Branch node).
optional_branch_filter (Name) – Defaults None. If specified, will only search the specified branch, otherwise searches all branches.
exact_match (bool) – Defaults false. If true, will not consider inherited classes to pass the OptionalClassFilter. (ie: If requesting a base class and only child classes exist, they will not count when using exact matching).
- Returns:
The first node found (if any) which contains the case-sensitive tag and is of the correct class type (if using OptionalClassFilter)
- Return type:
- get_nodes_for_branch(class_, branch_name, exact_match=False) Array[MovieGraphNode]¶
Finds all nodes (by type) for the given branch name (see GetBranchNames()). Returns all results of that type following traversal order (ie: right to left). To prevent accidentally editing unrelated assets, does not dive into sub-graphs (but can continue traversal beyond them), so returned results should only exist in current asset. Does not contain the Input or Output nodes, see GetInputNode() and GetOutputNode().
- Parameters:
class (type(Class)) – The node class type to search for. Use UMovieGraphSettingNode to only include nodes that show up in the final evaluated graph (excludes nodes like the Branch node).
branch_name (Name) – The branch to search for these nodes on.
exact_match (bool) – Defaults false. If true, will not consider inherited classes of InClass. (ie: If requesting a base class and only child classes exist, they will not count when using exact matching).
- Returns:
All nodes found (if any) which are of the specified InClass type on the given branch.
- Return type:
- get_nodes_for_tag(script_tag, optional_class_filter=None, optional_branch_filter='None', exact_match=False) Array[MovieGraphNode]¶
Finds nodes by ScriptTag field. THIS SEARCH IS CASE SENSITIVE. Returns all results of that tag found, following traversal order (ie: right to left). If OptionalClassFilter is specified, only matches against nodes that have the right class type and contain the correct tag. To prevent accidentally editing unrelated assets, does not dive into sub-graphs (but can continue traversal beyond them), so returned results should only exist in current asset. Does not contain the Input or Output nodes, see GetInputNode(), GetOutputNode())
- Parameters:
script_tag (str) – Case sensitive name into the “Script Tags” property on Nodes
optional_class_filter (type(Class)) – Defaults None. If specified, will only return a node of this class that matches the tag. Use UMovieGraphSettingNode to only include nodes that show up in the final evaluated graph (excludes nodes like the Branch node).
optional_branch_filter (Name) – Defaults None. If specified, will only search the specified branch, otherwise searches all branches.
exact_match (bool) – Defaults false. If true, will not consider inherited classes to pass the OptionalClassFilter. (ie: If requesting a base class and only child classes exist, they will not count when using exact matching).
- Returns:
All nodes found (if any) which contain the case-sensitive tag and are of the correct class type (if using OptionalClassFilter)
- Return type:
- get_output_directory() str¶
Walks the graph backward recursively from the output node searching for a UMovieGraphOutputSettings node. Traverses subgraphs as well. If a node is not found with an override set, value is taken from the CDO of UMovieGraphOutputSettings.
- Returns:
out_output_directory (str):
- Return type:
- get_output_node() MovieGraphNode¶
Gets the automatically generated “Outputs” node in the Graph.
- Return type:
- get_outputs() Array[MovieGraphOutput]¶
Gets all outputs that have been defined on the graph.
- Return type:
- get_upstream_branch_names(from_node, from_pin, stop_at_subgraph=False) Array[str]¶
Determines the name(s) of the branches upstream from FromNode, starting at FromPin. Optionally, subgraph nodes can halt graph traversal if bStopAtSubgraph is set to true.
- Parameters:
from_node (MovieGraphNode)
from_pin (MovieGraphPin)
stop_at_subgraph (bool)
- Return type:
- get_variable_by_guid(guid) MovieGraphVariable¶
Gets the variable in the graph with the specified GUID, else nullptr if one could not be found.
- Parameters:
guid (Guid)
- Return type:
- get_variable_by_name(variable_name) MovieGraphVariable¶
Gets the variable in the graph with the specified name (including global variables), else nullptr if one could not be found.
- Parameters:
variable_name (str)
- Return type:
- get_variables(include_global=False) Array[MovieGraphVariable]¶
Gets all variables that are available to be used in the graph. Global variables can optionally be included if bIncludeGlobal is set to true.
- Parameters:
include_global (bool)
- Return type:
- move_category_before(category_to_move, category_before) None¶
Moves one category (InCategoryToMove) and its variables before another category (InCategoryBefore).
- move_variable_before(target_variable, before_variable) None¶
Moves one variable (InTargetVariable) before another variable (InBeforeVariable). Takes care of ensuring the variable’s category is set properly after the move.
- Parameters:
target_variable (MovieGraphVariable)
before_variable (MovieGraphVariable)
- move_variable_to_index(target_variable, new_index) None¶
Moves one variable (InTargetVariable) to the specified index among all user graph variables.
Note that MoveVariableBefore() should be used in almost all cases unless there is very specific use case. This method will not take care of setting the category for you after the move unlike MoveVariableBefore().
- Parameters:
target_variable (MovieGraphVariable)
new_index (int32)
- remove_all_inbound_edges(node) bool¶
Convenience function which removes all Inbound (pins on the left side of a node) edges for the given node.
- Parameters:
node (MovieGraphNode)
- Return type:
- remove_all_outbound_edges(node) bool¶
Convenience function which removes all Outbound (pins on the right side of a node) edges for the given node.
- Parameters:
node (MovieGraphNode)
- Return type:
- remove_inbound_edges(node, pin_name) bool¶
Convenience function which removes all Inbound (pins on the left side of a node) edges connected to the given inbound pin by name, for the given node.
- Parameters:
node (MovieGraphNode)
pin_name (Name)
- Return type:
- remove_labeled_edge(from_node, from_pin_name, to_node, to_pin_name) bool¶
Like AddLabeledEdge, removes the given connection between Node A and Node B (for the specified pins by name).
- Parameters:
from_node (MovieGraphNode)
from_pin_name (Name)
to_node (MovieGraphNode)
to_pin_name (Name)
- Return type:
- remove_node(node) bool¶
Removes the specified node from the graph, disconnecting connected edges as it goes.
- Parameters:
node (MovieGraphNode)
- Return type:
- remove_nodes(nodes) bool¶
Like RemoveNode but takes an entire array at once for convenience.
- Parameters:
nodes (Array[MovieGraphNode])
- Return type:
- remove_outbound_edges(node, pin_name) bool¶
Convenience function which removes all Outbound (pins on the right side of a node) edges connected to the given outbound pin by name, for the given node.
- Parameters:
node (MovieGraphNode)
pin_name (Name)
- Return type:
- update_global_variable_values(pipeline) None¶
Updates the values of all global variables.
- Parameters:
pipeline (MovieGraphPipeline)