Node

class omni.graph.core.Node

Methods

__init__(*args, **kwargs)

clear_old_compute_messages(self)

Clears all compute messages logged for the node prior to its most recent evaluation.

create_attribute(self, attributeName, ...)

Creates an attribute with the specified name, type, and port type and returns success state.

deregister_on_connected_callback(self, arg0)

De-registers the on_connected callback to be invoked when attributes connect.

deregister_on_disconnected_callback(self, arg0)

De-registers the on_disconnected callback to be invoked when attributes disconnect.

deregister_on_path_changed_callback(self, arg0)

De-registers the on_path_changed callback to be invoked when anything changes in the stage.

get_attribute(self, name)

Given the name of an attribute returns an attribute object to it.

get_attribute_exists(self, name)

Given an attribute name, returns whether this attribute exists or not.

get_attributes(self)

Returns the list of attributes on this node.

get_backing_bucket_id(self)

Finds this node's bucket id within the backing store.

get_compute_count(self)

Returns the number of times this node's compute() has been called.

get_compute_messages(self, severity)

Returns a list of the compute messages currently logged for the node at a specific severity.

get_dynamic_downstream_control(self)

Returns whether the current node can influence the execution of downstream nodes in dynamic scheduling

get_event_stream(self)

Get the event stream the node uses for notification of changes.

get_graph(self)

Returns the graph associated with the current node.

get_handle(self)

Returns the handle to the node as an uint64.

get_node_type(self)

returns

(omni.graph.core.NodeType) The node type from which this node was created.

get_prim_path(self)

Returns the path to the prim currently backing the node.

get_python_type_name(self)

[DEPRECATED - use get_node_type() For Python nodes only, returns the python type name of the node

get_type_name(self)

Returns the type name of the current node.

get_wrapped_graph(self)

Returns (omni.graph.core.Graph) the graph wrapped by the current node, if any.

increment_compute_count(self)

Increments the node's compute counter.

is_backed_by_usd(self)

Returns whether the current node is by an USD prim on the stage.

is_compound_node(self)

Returns whether this node is a compound node.

is_disabled(self)

Returns whether the current node is disabled.

is_valid(self)

Returns whether the current node is valid or not.

log_compute_message(self, severity, message)

Logs a compute message of a given severity for the node.

node_id(self)

Returns a unique identifier value for this node.

register_on_connected_callback(self, arg0)

Registers a callback to be invoked when the node has attributes connected.

register_on_disconnected_callback(self, arg0)

Registers a callback to be invoked when the node has attributes disconnected.

register_on_path_changed_callback(self, arg0)

Registers a callback to be invoked when a path changes in the stage.

remove_attribute(self, attributeName)

Removes an attribute with the specified name and type and returns success state.

request_compute(self)

returns

(bool) True if the request was successful, False if there was an error

resolve_coupled_attributes(self, attributesArray)

Resolves attribute types given a set of attributes which are fully type coupled.

resolve_partially_coupled_attributes(self, ...)

Resolves attribute types given a set of attributes, that can have differing tuple counts and/or array depth, and differing but convertible base data type.

set_compute_incomplete(self)

Informs the system that compute is incomplete for this frame.

set_disabled(self, arg0)

Sets whether the current node is disabled or not.

set_dynamic_downstream_control(self, arg0)

Sets whether the current node can influence the execution of downstream nodes in dynamic scheduling

__init__(*args, **kwargs)
clear_old_compute_messages(self: omni.graph.core._omni_graph_core.Node) int

Clears all compute messages logged for the node prior to its most recent evaluation. Messages logged during the most recent evaluation remain untouched.

Normally this will be called during graph evaluation so it is of little use unless you’re writing your own evaluation manager.

Returns

(int) The number of messages that were deleted.

create_attribute(self: omni.graph.core._omni_graph_core.Node, attributeName: str, attributeType: omni::graph::core::Py_Type, portType: omni.graph.core._omni_graph_core.AttributePortType = <AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT: 0>, value: object = None, extendedType: omni.graph.core._omni_graph_core.ExtendedAttributeType = <ExtendedAttributeType.EXTENDED_ATTR_TYPE_REGULAR: 0>, unionTypes: str = '') bool

Creates an attribute with the specified name, type, and port type and returns success state.

Parameters
  • arg0 (str) – Name of the attribute.

  • arg1 (omni.graph.core.Type) – Type of the attribute.

  • arg2 (omni.graph.core.AttributePortType) – The port type of the attribute, defaults to omni.graph.core.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT

  • arg3 (Any) – The initial value to set on the attribute, default is None

  • arg4 (omni.graph.core.ExtendedAttributeType) – The extended type of the attribute, defaults to omni.graph.core.ExtendedAttributeType.EXTENDED_ATTR_TYPE_REGULAR

  • arg5 (str) – Comma-separated list of union types if the extended type is EXTENDED_ATTR_TYPE_UNION, defaults to empty string for non-union types.

Returns

(bool) True if the creation was successful, else False

deregister_on_connected_callback(self: omni.graph.core._omni_graph_core.Node, arg0: int) None

De-registers the on_connected callback to be invoked when attributes connect.

Parameters

arg0 (Function) – The handle that was returned during the register_on_connected_callback call

deregister_on_disconnected_callback(self: omni.graph.core._omni_graph_core.Node, arg0: int) None

De-registers the on_disconnected callback to be invoked when attributes disconnect.

Parameters

arg0 (Function) – The handle that was returned during the register_on_disconnected_callback call

deregister_on_path_changed_callback(self: omni.graph.core._omni_graph_core.Node, arg0: int) None

De-registers the on_path_changed callback to be invoked when anything changes in the stage. [DEPRECATED]

Parameters

arg0 (Function) – The handle that was returned during the register_on_path_changed_callback call

get_attribute(self: omni.graph.core._omni_graph_core.Node, name: str) omni.graph.core._omni_graph_core.Attribute

Given the name of an attribute returns an attribute object to it.

Parameters

name (str) – The name of the attribute

Returns

Attribute with the given name, or None if it does not exist on the node

Return type

(omni.graph.core.Attribute)

get_attribute_exists(self: omni.graph.core._omni_graph_core.Node, name: str) bool

Given an attribute name, returns whether this attribute exists or not.

Parameters

name (str) – The name of the attribute

Returns

(bool) True if the attribute exists on this node, else False

get_attributes(self: omni.graph.core._omni_graph_core.Node) List[omni.graph.core._omni_graph_core.Attribute]

Returns the list of attributes on this node.

get_backing_bucket_id(self: omni.graph.core._omni_graph_core.Node) omni::fabric::BucketId

Finds this node’s bucket id within the backing store. The id is only valid until the next modification of the backing store, so do not hold on to it.

Returns

(int) The bucket id, raises ValueError if the look up fails.

get_compute_count(self: omni.graph.core._omni_graph_core.Node) int

Returns the number of times this node’s compute() has been called. The counter has a limited range and will eventually roll over to 0, so a higher count cannot be assumed to represent a more recent compute than an older one.

Returns

(int) Number of times this node’s compute() has been called since the counter last rolled over to 0.

get_compute_messages(self: omni.graph.core._omni_graph_core.Node, severity: omni::graph::core::ogn::Severity) List[str]

Returns a list of the compute messages currently logged for the node at a specific severity.

Parameters

arg0 (omni.graph.core.Severity) – Severity level of the message.

Returns

(str) The list of messages. If no messages were found an empty list will be returned.

get_dynamic_downstream_control(self: omni.graph.core._omni_graph_core.Node) bool

Returns whether the current node can influence the execution of downstream nodes in dynamic scheduling

get_event_stream(self: omni.graph.core._omni_graph_core.Node) carb::events::IEventStream

Get the event stream the node uses for notification of changes.

Returns

Event stream to monitor for node changes

Return type

(carb.events._events.IEventStream)

get_graph(self: omni.graph.core._omni_graph_core.Node) omni::graph::core::Py_Graph

Returns the graph associated with the current node. The returned graph will be invalid if the node is not valid.

get_handle(self: omni.graph.core._omni_graph_core.Node) int

Returns the handle to the node as an uint64.

get_node_type(self: omni.graph.core._omni_graph_core.Node) omni::graph::core::Py_NodeType
Returns

(omni.graph.core.NodeType) The node type from which this node was created.

get_prim_path(self: omni.graph.core._omni_graph_core.Node) str

Returns the path to the prim currently backing the node.

get_python_type_name(self: omni.graph.core._omni_graph_core.Node) str

[DEPRECATED - use get_node_type() For Python nodes only, returns the python type name of the node

get_type_name(self: omni.graph.core._omni_graph_core.Node) str

Returns the type name of the current node.

get_wrapped_graph(self: omni.graph.core._omni_graph_core.Node) omni::graph::core::Py_Graph

Returns (omni.graph.core.Graph) the graph wrapped by the current node, if any. The returned graph will be invalid if the node does not wrap a graph.

increment_compute_count(self: omni.graph.core._omni_graph_core.Node) int

Increments the node’s compute counter. This method is provided primarily for debugging and experimental uses and should not normally be used by end-users.

Returns

(int) The new compute counter. This may be zero if the counter has just rolled over.

is_backed_by_usd(self: omni.graph.core._omni_graph_core.Node) bool

Returns whether the current node is by an USD prim on the stage.

is_compound_node(self: omni.graph.core._omni_graph_core.Node) bool

Returns whether this node is a compound node. A compound node is a node that has a node type that is defined by an OmniGraph.

Returns

(bool) True if this node is a compound node, false otherwise.

is_disabled(self: omni.graph.core._omni_graph_core.Node) bool

Returns whether the current node is disabled.

is_valid(self: omni.graph.core._omni_graph_core.Node) bool

Returns whether the current node is valid or not.

log_compute_message(self: omni.graph.core._omni_graph_core.Node, severity: omni::graph::core::ogn::Severity, message: str) bool

Logs a compute message of a given severity for the node.

This method is intended to be used from within the compute() method of a node to alert the user to any problems or issues with the node’s most recent evaluation. They are accumulated until the next successful evaluation at which point they are cleared.

If duplicate messages are logged, with the same severity level, only one is stored.

Parameters
Returns

(bool) True if the message has already been logged, else False

node_id(self: omni.graph.core._omni_graph_core.Node) int

Returns a unique identifier value for this node.

Returns

Unique identifier value for the node - not persistent through file save and load

Return type

(int)

register_on_connected_callback(self: omni.graph.core._omni_graph_core.Node, arg0: object) int

Registers a callback to be invoked when the node has attributes connected. The callback takes 2 parameters: the attributes from and attribute to of the connection.

Parameters

arg0 (Function) – The callback function

Returns

A handle that could be used for deregistration.

register_on_disconnected_callback(self: omni.graph.core._omni_graph_core.Node, arg0: object) int

Registers a callback to be invoked when the node has attributes disconnected. The callback takes 2 parameters: the attributes from and attribute to of the disconnection.

Parameters

arg0 (Function) – The callback function

Returns

A handle that could be used for deregistration.

register_on_path_changed_callback(self: omni.graph.core._omni_graph_core.Node, arg0: object) int

Registers a callback to be invoked when a path changes in the stage. The callback takes 1 parameter: a list of the paths that were changed. [DEPRECATED]

Parameters

arg0 (Function) – The callback function

Returns

A handle that could be used for deregistration.

remove_attribute(self: omni.graph.core._omni_graph_core.Node, attributeName: str) bool

Removes an attribute with the specified name and type and returns success state.

Parameters

arg0 (str) – Name of the attribute.

Returns

True if the removal was successful, False if the attribute was not found

Return type

(bool)

request_compute(self: omni.graph.core._omni_graph_core.Node) bool
Returns

(bool) True if the request was successful, False if there was an error

resolve_coupled_attributes(self: omni.graph.core._omni_graph_core.Node, attributesArray: List[omni.graph.core._omni_graph_core.Attribute]) bool

Resolves attribute types given a set of attributes which are fully type coupled. For example if node ‘Increment’ has one input attribute ‘a’ and one output attribute ‘b’ and the types of ‘a’ and ‘b’ should always match. If the input is resolved then this function will resolve the output to the same type. It will also take into consideration available conversions on the input size. The type of the first (resolved) provided attribute will be used to resolve others or select appropriate conversions

Note that input attribute types are never inferred from output attribute types.

This function should only be called from the INodeType function ‘on_connection_type_resolve’

Parameters

arg0 (numpy.array[omni.graph.core.Attribute]) – Array of attributes to be resolved as a coupled group

Returns

(bool) True if successful, False otherwise, usually due to mismatched or missing resolved types

resolve_partially_coupled_attributes(self: omni.graph.core._omni_graph_core.Node, attributesArray: List[omni.graph.core._omni_graph_core.Attribute], tuplesArray: List[int], arraySizesArray: List[int], rolesArray: List[omni::fabric::AttributeRole]) bool

Resolves attribute types given a set of attributes, that can have differing tuple counts and/or array depth, and differing but convertible base data type. The three input buffers are tied together, holding the attribute, the tuple count, and the array depth of the types to be coupled. This function will solve base type conversion by targeting the first provided type in the list, for all other ones that require it.

For example if node ‘makeTuple2’ has two input attributes ‘a’ and ‘b’ and one output ‘c’ and we want to resolve any float connection to the types ‘a’:float, ‘b’:float, ‘c’:float[2] (convertible base types and different tuple counts) then the input buffers would contain: attrsBuf = [a, b, c] tuplesBuf = [1, 1, 2] arrayDepthsBuf = [0, 0, 0] rolesBuf = [AttributeRole::eNone, AttributeRole::eNone, AttributeRole::eNone]

This is worth noting that ‘b’ could be of any type convertible to float. But since the first provided attribute is ‘a’, the type of ‘a’ will be used to propagate the type resolution.

Note that input attribute types are never inferred from output attribute types.

This function should only be called from the INodeType function ‘on_connection_type_resolve’

Parameters
  • arg0 (numpy.array[omni.graph.core.Attribute]) – Array of attributes to be resolved as a coupled group

  • arg1 (numpy.array[int]) – Array of tuple count desired for each corresponding attribute. Any value of None indicates the found tuple count is to be used when resolving.

  • arg2 (numpy.array[int]) – Array of array depth desired for each corresponding attribute. Any value of None indicates the found array depth is to be used when resolving.

  • arg3 (numpy.array[omni.graph.core.AttributeRole]) – Array of role desired for each corresponding attribute. Any value of AttributeRole::eUnknown/None indicates the found role is to be used when resolving.

Returns

True if successful, False otherwise, usually due to mismatched or missing resolved types

Return type

(bool)

set_compute_incomplete(self: omni.graph.core._omni_graph_core.Node) None

Informs the system that compute is incomplete for this frame. In lazy evaluation systems, this node will be scheduled on the next frame since it still has more work to do.

set_disabled(self: omni.graph.core._omni_graph_core.Node, arg0: bool) None

Sets whether the current node is disabled or not.

Parameters

arg0 (bool) – True for disabled, False for not.

set_dynamic_downstream_control(self: omni.graph.core._omni_graph_core.Node, arg0: bool) None

Sets whether the current node can influence the execution of downstream nodes in dynamic scheduling

Parameters

arg0 (bool) – True for being able to disable downstream nodes, False otherwise