Graph
- class omni.graph.core.Graph
Methods
__init__
(*args, **kwargs)change_pipeline_stage
(self, newPipelineStage)Change the pipeline stage that this graph is in (simulation, pre-render, post-render, on-demand)
create_graph_as_node
(self, name, path, ...)Creates a graph that is wrapped by a node in the current graph.
create_node
(self, arg0, arg1, arg2)Given the path to the node and the type of the node, creates a node of that type at that path.
create_subgraph
(self, subgraphPath[, ...])Given the path to the subgraph, create the subgraph at that path.
create_variable
(self, name, type)Creates a variable on the graph.
De-registers the error status change callback to be invoked when the error status of nodes change during evaluation.
destroy_node
(self, node_path, update_usd)Given the path to the node, destroys the node at that path.
evaluate
(self)Tick the graph by causing it to evaluate.
find_variable
(self, name)Find the variable with the given name in the graph.
get_context
(self)Returns the context associated to the graph
Returns default graph context associated with this graph.
get_evaluator_name
(self)Returns the name of the graph evaluator (dirty_push, push, pull, execution, execution_pull)
get_event_stream
(self)Get the event stream the graph uses for notification of changes.
get_graph_backing_type
(self)Returns the type of data structure backing this graph (fabric with history, wihout history, shared)
get_handle
(self)Returns the handle to the graph as a uint64
get_node
(self, arg0)Given a path to the node, returns the object for the node.
get_nodes
(self)Returns a list of the nodes in this graph.
get_parent_graph
(self)Returns the immediate parent graph of this graph (may be None)
get_path_to_graph
(self)Returns the path to the graph (may be empty).
get_pipeline_stage
(self)Returns the type of pipeline stage of this graph (simulation, pre-render, post-render)
get_subgraph
(self, arg0)Given a path to the subgraph, returns the object for the subgraph.
get_subgraphs
(self)Returns a list of the subgraphs contained in this graph.
get_variables
(self)Returns the list of variables defined on the graph.
inspect
(self, inspector)Runs the inspector on the graph
is_compound_graph
(self)Returns whether this graph is a compound graph.
is_disabled
(self)Returns whether this graph object is disabled.
is_valid
(self)Returns whether this graph object is valid or not.
print_diagnostic
(self)Prints out the graph in text form for inspection of its state.
register_error_status_change_callback
(self, ...)Registers a callback to be invoked after graph evaluation for all the nodes whose error status changed during the evaluation.
reload_from_stage
(self)reload the graph by deleting it and re-parsing from the stage.
reload_settings
(self)reload the graph settings.
remove_variable
(self, variable)Removes the given variable from the graph.
rename_node
(self, arg0, arg1)Given the path to the node, renames the node at that path.
rename_subgraph
(self, arg0, arg1)Given the path to the node, renames the subgraph at that path.
set_disabled
(self, arg0)Sets whether this graph object is to be disabled or not.
set_usd_notice_handling_enabled
(self, arg0)Sets whether this graph object has USD notice handling enabled.
Returns whether this graph object has USD notice handling enabled.
Attributes
The evaluation mode sets how the graph will be evaluated.
- __init__(*args, **kwargs)
- change_pipeline_stage(self: omni.graph.core._omni_graph_core.Graph, newPipelineStage: omni.graph.core._omni_graph_core.GraphPipelineStage) None
Change the pipeline stage that this graph is in (simulation, pre-render, post-render, on-demand)
- Parameters
newPipelineStage (omni.graph.core.GraphPipelineStage) – The new pipeline stage of the graph
- create_graph_as_node(self: omni.graph.core._omni_graph_core.Graph, name: str, path: str, evaluator: str, is_global_graph: bool, is_backed_by_usd: bool, backing_type: omni.graph.core._omni_graph_core.GraphBackingType, pipeline_stage: omni.graph.core._omni_graph_core.GraphPipelineStage, evaluation_mode: omni.graph.core._omni_graph_core.GraphEvaluationMode = <GraphEvaluationMode.GRAPH_EVALUATION_MODE_AUTOMATIC: 0>) omni.graph.core._omni_graph_core.Node
Creates a graph that is wrapped by a node in the current graph.
- Parameters
arg0 (str) – The name of the node
arg1 (str) – The path to the graph
arg2 (str) – The name of the evaluator to use for the graph
arg3 (bool) – Whether this is a global graph
arg4 (bool) – Whether the constructs are to be backed by USD
arg5 (omni.graph.core.GraphBackingType) – The kind of cache backing this graph
arg6 (omni.graph.core.GraphPipelineStage) – What stage in the pipeline the global graph is at (simulation, pre-render, post-render)
arg7 (omni.graph.core.GraphEvaluationMode) – What mode to use when evaluating the graph
- Returns
Node wrapping the graph that was created
- Return type
- create_node(self: omni.graph.core._omni_graph_core.Graph, arg0: str, arg1: str, arg2: bool) omni.graph.core._omni_graph_core.Node
Given the path to the node and the type of the node, creates a node of that type at that path.
- Parameters
arg0 (str) – The path to the node
arg1 (str) – The type of the node
write (bool) – Whether or not to create the USD backing for the node
- create_subgraph(self: omni.graph.core._omni_graph_core.Graph, subgraphPath: str, evaluator: str = '', createUsd: bool = True) omni.graph.core._omni_graph_core.Graph
Given the path to the subgraph, create the subgraph at that path.
- Parameters
arg0 (str) – The path to the subgraph
arg1 (str) – The evaluator type
write (bool) – Whether or not to create the USD backing for the node
- Returns
Subgraph object created for the given path.
- Return type
- create_variable(self: omni.graph.core._omni_graph_core.Graph, name: str, type: omni::graph::core::Py_Type) omni.graph.core._omni_graph_core.IVariable
Creates a variable on the graph.
- Parameters
name (str) – The name of the variable
type (omni.graph.core.Type) – The type of the variable to create.
- Returns
A reference to the newly created variable, or None if the variable could not be created.
- Return type
- deregister_error_status_change_callback(self: omni.graph.core._omni_graph_core.Graph, status_change_handle: int) None
De-registers the error status change callback to be invoked when the error status of nodes change during evaluation.
- Parameters
postload_handle (int) – The handle that was returned during the register_error_status_change_callback call
- destroy_node(self: omni.graph.core._omni_graph_core.Graph, node_path: str, update_usd: bool) bool
Given the path to the node, destroys the node at that path.
- Parameters
node_path (str) – The path to the node
update_usd (bool) – Whether or not to destroy the USD backing for the node
- evaluate(self: omni.graph.core._omni_graph_core.Graph) None
Tick the graph by causing it to evaluate. This is an advanced functionality.
- find_variable(self: omni.graph.core._omni_graph_core.Graph, name: str) omni.graph.core._omni_graph_core.IVariable
Find the variable with the given name in the graph.
- Parameters
name (str) – The name of the variable to find.
- Returns
(omni.graph.core.IVariable) The variable with the given name, or None if not found.
- get_context(self: omni.graph.core._omni_graph_core.Graph) omni::graph::core::Py_GraphContext
Returns the context associated to the graph
Returns: the context associated to the graph
- get_default_graph_context(self: omni.graph.core._omni_graph_core.Graph) omni::graph::core::Py_GraphContext
Returns default graph context associated with this graph.
- get_evaluator_name(self: omni.graph.core._omni_graph_core.Graph) str
Returns the name of the graph evaluator (dirty_push, push, pull, execution, execution_pull)
- get_event_stream(self: omni.graph.core._omni_graph_core.Graph) carb::events::IEventStream
Get the event stream the graph uses for notification of changes.
- Returns
Event stream to monitor for graph changes
- Return type
(carb.events._events.IEventStream)
- get_graph_backing_type(self: omni.graph.core._omni_graph_core.Graph) omni.graph.core._omni_graph_core.GraphBackingType
Returns the type of data structure backing this graph (fabric with history, wihout history, shared)
- get_handle(self: omni.graph.core._omni_graph_core.Graph) int
Returns the handle to the graph as a uint64
- get_node(self: omni.graph.core._omni_graph_core.Graph, arg0: str) omni.graph.core._omni_graph_core.Node
Given a path to the node, returns the object for the node.
- Parameters
arg0 (str) – The path to the node
- Returns
Node object for the given path, None if it does not exist
- Return type
- get_nodes(self: omni.graph.core._omni_graph_core.Graph) List[omni.graph.core._omni_graph_core.Node]
Returns a list of the nodes in this graph.
- get_parent_graph(self: omni.graph.core._omni_graph_core.Graph) object
Returns the immediate parent graph of this graph (may be None)
- get_path_to_graph(self: omni.graph.core._omni_graph_core.Graph) str
Returns the path to the graph (may be empty).
- get_pipeline_stage(self: omni.graph.core._omni_graph_core.Graph) omni.graph.core._omni_graph_core.GraphPipelineStage
Returns the type of pipeline stage of this graph (simulation, pre-render, post-render)
- get_subgraph(self: omni.graph.core._omni_graph_core.Graph, arg0: str) omni.graph.core._omni_graph_core.Graph
Given a path to the subgraph, returns the object for the subgraph.
- Parameters
arg0 (str) – The path to the subgraph
- Returns
Subgraph object for the given path, None if it does not exist
- Return type
- get_subgraphs(self: omni.graph.core._omni_graph_core.Graph) List[omni.graph.core._omni_graph_core.Graph]
Returns a list of the subgraphs contained in this graph.
- get_variables(self: omni.graph.core._omni_graph_core.Graph) List[omni.graph.core._omni_graph_core.IVariable]
Returns the list of variables defined on the graph.
- Returns
A list of (omni.graph.core.IVariable) representing variables on the graph.
- inspect(self: omni.graph.core._omni_graph_core.Graph, inspector: omni::core::Api<omni::inspect::IInspector_abi>) bool
Runs the inspector on the graph
- Parameters
arg0 (omni.inspect.Inspector) – The inspector to run
- Returns
True if the inspector was successfully run on the graph, False if it is not supported
- Return type
(bool)
- is_compound_graph(self: omni.graph.core._omni_graph_core.Graph) bool
Returns whether this graph is a compound graph. A compound graph is subgraph that controlled by a compound node.
Returns: true if this graph is a compound graph
- is_disabled(self: omni.graph.core._omni_graph_core.Graph) bool
Returns whether this graph object is disabled.
- is_valid(self: omni.graph.core._omni_graph_core.Graph) bool
Returns whether this graph object is valid or not.
- print_diagnostic(self: omni.graph.core._omni_graph_core.Graph) None
Prints out the graph in text form for inspection of its state.
- register_error_status_change_callback(self: omni.graph.core._omni_graph_core.Graph, callback: object) int
Registers a callback to be invoked after graph evaluation for all the nodes whose error status changed during the evaluation. The callback receives a list of the nodes whose error status changed.
- Parameters
callback (Callable) – The callback function
- Returns
A handle that can be used for deregistration - note the calling module is responsible for deregistration
- Return type
(int)
of the callback in all circumstances - including where the extension is hot-reloaded.
- reload_from_stage(self: omni.graph.core._omni_graph_core.Graph) None
reload the graph by deleting it and re-parsing from the stage.
- reload_settings(self: omni.graph.core._omni_graph_core.Graph) None
reload the graph settings.
- remove_variable(self: omni.graph.core._omni_graph_core.Graph, variable: omni.graph.core._omni_graph_core.IVariable) bool
Removes the given variable from the graph.
- Parameters
variable (omni.graph.core.IVariable) – The variable to remove.
- Returns
(bool) True if the variable was successfully removed, False otherwise.
- rename_node(self: omni.graph.core._omni_graph_core.Graph, arg0: str, arg1: str) bool
Given the path to the node, renames the node at that path.
- Parameters
arg0 (str) – The path to the node
arg1 (str) – The new path
- rename_subgraph(self: omni.graph.core._omni_graph_core.Graph, arg0: str, arg1: str) bool
Given the path to the node, renames the subgraph at that path.
- Parameters
arg0 (str) – The path to the subgraph
arg1 (str) – The new path
- set_disabled(self: omni.graph.core._omni_graph_core.Graph, arg0: bool) None
Sets whether this graph object is to be disabled or not.
- set_usd_notice_handling_enabled(self: omni.graph.core._omni_graph_core.Graph, arg0: bool) None
Sets whether this graph object has USD notice handling enabled. This is advanced functionality.
- Parameters
arg0 (bool) – Whether or not to enable USD notice handling.
- usd_notice_handling_enabled(self: omni.graph.core._omni_graph_core.Graph) bool
Returns whether this graph object has USD notice handling enabled.
- property evaluation_mode
The evaluation mode sets how the graph will be evaluated.
GRAPH_EVALUATION_MODE_AUTOMATIC - Evaluate the graph in Standalone mode when there are no relationships to it, otherwise it will be evaluated in Instanced mode.
GRAPH_EVALUATION_MODE_STANDALONE - Evaluates the graph with the graph Prim as the graph target, and ignore Prims with relationships to the graph Prim. Use this mode when constructing self-contained graphs that evaluate independently.
GRAPH_EVALUATION_MODE_INSTANCED - Evaluates only when the graph there are relationships from OmniGraphAPI interfaces. Each Prim with a relationship to the graph Prim will cause an evaluation, with the Graph Target set to path of Prim with the OmniGraphAPI interface. Use this mode when the graph represents as an asset or template that can be applied to multiple Prims.