OmniGraph Python API Documentation

This file contains the interfaces that external Python scripts can use. Import this file and use the APIs exposed below.

To get documentation on this module and methods import this file into a Python interpreter and run dir/help, like this:

import omni.graph.core as og
dir(og)
help(og.get_graph_by_path)
class omni.graph.core.Attribute
connect(self: omni.graph.core._omni_graph_core.Attribute, path: omni.graph.core._omni_graph_core.Attribute, modify_usd: bool)bool

Connects this attribute with another attribute. Assumes regular connection type. :param path: The destination attr :type path: Attribute :param modify_usd: Whether to create USD. :type modify_usd: bool

Returns

(bool) True for success, False for fail

connectEx(self: omni.graph.core._omni_graph_core.Attribute, info: omni.graph.core._omni_graph_core.ConnectionInfo, modify_usd: bool)bool

Connects this attribute with another attribute. Allows for different connection types.

Parameters
  • info (ConnectionInfo) – The ConnectionInfo object that contains both the attribute and the connection type

  • modify_usd (bool) – Whether to modify the underlying USD with this connection

Returns

(bool) True for success, False for fail

connectPrim(self: omni.graph.core._omni_graph_core.Attribute, path: str, modify_usd: bool, write: bool)bool

Connects this attribute to a prim that can represent a bundle connection or just a plain prim relationship :param path: The path to the prim :type path: str :param modify_usd: Whether to modify USD. :type modify_usd: bool :param write: Whether this connection represents a bundle :type write: bool

Returns

(bool) True for success, False for fail

disconnect(self: omni.graph.core._omni_graph_core.Attribute, attribute: omni.graph.core._omni_graph_core.Attribute, modify_usd: bool)bool

Disconnects this attribute from another attribute. :param attribute: The destination attr of the connection to remove :type attribute: Attribute :param modify_usd: Whether to modify USD. :type modify_usd: bool

Returns

(bool) True for success, False for fail

disconnectPrim(self: omni.graph.core._omni_graph_core.Attribute, path: str, modify_usd: bool, write: bool)bool

Disconnects this attribute to a prim that can represent a bundle connection or just a plain prim relationship :param path: The path to the prim :type path: str :param modify_usd: Whether to modify USD. :type modify_usd: bool :param write: Whether this connection represents a bundle :type write: bool

Returns

(bool) True for success, False for fail

get(self: omni.graph.core._omni_graph_core.Attribute, on_gpu: bool = False)object
Parameters

on_gpu (bool) – Is the data to be retrieved from the GPU?

Returns

Value of the attribute’s data

Return type

(Any)

get_all_metadata(self: omni.graph.core._omni_graph_core.Attribute)dict

Returns a dictionary of metadata on the attribute.

get_array(self: omni.graph.core._omni_graph_core.Attribute, on_gpu: bool = False, get_for_write: bool, reserved_element_count: int)object
Parameters
  • on_gpu (bool) – Is the data to be retrieved from the GPU?

  • get_for_write (bool) – Should the data be retrieved for writing?

  • reserved_element_count (int) – If the data is to be retrieved for writing, preallocate this many elements

Returns

Value of the attribute’s data

Return type

(Any)

get_attribute_data(self: omni.graph.core._omni_graph_core.Attribute)omni::graph::core::Py_AttributeData

Returns the underlying attribute data accessor object for this attribute.

get_disable_dynamic_downstream_work(self: omni.graph.core._omni_graph_core.Attribute)bool
Returns

True if downstream nodes are disabled in dynamic scheduling, False otherwise

get_downstream_connection_count(self: omni.graph.core._omni_graph_core.Attribute)int

Returns the number of downstream connections for this attribute.

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

Returns the list of upstream connections for this attribute.

get_downstream_connections_info(self: omni.graph.core._omni_graph_core.Attribute)List[omni.graph.core._omni_graph_core.ConnectionInfo]

Returns the list of downstream connections for this attribute, with detailed connection information such as the connection type.

Returns: a list of the downstream ConnectionInfo objects

get_extended_type(self: omni.graph.core._omni_graph_core.Attribute)omni.graph.core._omni_graph_core.ExtendedAttributeType

Returns the extended type of the current attribute.

Returns

Extended type of the attribute data object

Return type

[omni.graph.core.ExtendedType]

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

Returns the handle to the attribute as an uint64.

get_metadata(self: omni.graph.core._omni_graph_core.Attribute, key: str)str

Returns the metadata value for the given key.

Parameters

key (str) – The metadata keyword

Returns

Metadata value for the given keyword, or None if it is not defined

Return type

(str)

get_metadata_count(self: omni.graph.core._omni_graph_core.Attribute)int

Returns the number of metadata values currently defined on the attribute.

get_name(self: omni.graph.core._omni_graph_core.Attribute)str

Returns the name of the current attribute.

get_node(self: omni.graph.core._omni_graph_core.Attribute)omni::graph::core::Py_Node

Returns the node associated with the attribute.

get_path(self: omni.graph.core._omni_graph_core.Attribute)str

Returns the full path to the attribute, including the node path.

get_port_type(self: omni.graph.core._omni_graph_core.Attribute)omni.graph.core._omni_graph_core.AttributePortType

Returns the port type of the attribute.

get_resolved_type(self: omni.graph.core._omni_graph_core.Attribute)omni::graph::core::Py_Type

Returns the resolved type of the extended attribute, or the hardcoded type for regular attributes.

Returns

Resolved type of the attribute data object

Return type

[omni.graph.core.Type]

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

Returns the type name of the current attribute.

get_union_types(self: omni.graph.core._omni_graph_core.Attribute)object

Returns the list of accepted types for the attribute if it is an extended union type, else None

get_upstream_connection_count(self: omni.graph.core._omni_graph_core.Attribute)int

Returns the number of upstream connections for this attribute.

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

Returns the list of upstream connections for this attribute.

get_upstream_connections_info(self: omni.graph.core._omni_graph_core.Attribute)List[omni.graph.core._omni_graph_core.ConnectionInfo]

Returns the list of upstream connections for this attribute, with detailed connection information such as the connection type.

Returns: a list of the upstream ConnectionInfo objects

property gpu_ptr_kind

Defines the memory space that GPU array data pointers live in

is_compatible(self: omni.graph.core._omni_graph_core.Attribute, arg0: omni.graph.core._omni_graph_core.Attribute)bool

Returns whether this attribute is compatible with another.

is_connected(self: omni.graph.core._omni_graph_core.Attribute, arg0: omni.graph.core._omni_graph_core.Attribute)bool

Returns whether this attribute is connected to another.

is_dynamic(self: omni.graph.core._omni_graph_core.Attribute)bool

Returns whether the current attribute is a dynamic attribute (not in the node type definition).

property is_optional_for_compute

Flag that is set when an attribute need not be valid for compute() to happen. (bool)

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

Returns whether the current attribute is valid.

register_value_changed_callback(self: omni.graph.core._omni_graph_core.Attribute, func: object)None

Registers a function that will be invoked when the value of the given attribute changes.

Note that an attribute can have one and only one callback. Subsequent calls will replace previously set callbacks. Passing None for the function argument will clear the existing callback.

Parameters

func (Function) –

resolved_prefix = '__resolved_'
set(self: omni.graph.core._omni_graph_core.Attribute, value: object, on_gpu: bool = False)bool

Sets the value of the attribute’s data

Parameters
  • value (Any) – New value of the attribute’s data

  • on_gpu (bool) – Is the data to be set on the GPU?

Returns

True if the value was successfully set

Return type

(bool)

set_disable_dynamic_downstream_work(self: omni.graph.core._omni_graph_core.Attribute, disable: bool)None

Sets whether downstream nodes are disabled in dynamic scheduling

Parameters

disable (bool) – Whether to disable downstream connected nodes in dynamic scheduling.

set_metadata(self: omni.graph.core._omni_graph_core.Attribute, key: str, value: str)bool

Sets the metadata value for the given key.

Parameters
  • key (str) – The metadata keyword

  • value (str) – The value of the metadata

set_resolved_type(self: omni.graph.core._omni_graph_core.Attribute, arg0: omni::graph::core::Py_Type)None

Sets the resolved type for the extended attribute. Only valid for attributes with union/any extended types, who’s type has not yet been resolved. Should only be called from on_connection_type_resolve() callback. This operation is async and may fail if the type cannot be resolved as requested.

Parameters

is_valid (omni.graph.core.Type) – The type to resolve the attribute to

update_attribute_value(self: omni.graph.core._omni_graph_core.Attribute, update_immediately: bool)bool

Requests the value of an attribute. In the cases of lazy evaluation systems, this generates the “pull” that causes the attribute to update its value.

Parameters

update_immediately (bool) – Whether to update the attribute value immediately. If True, the function will block until the attribute is update and then return. If False, the attribute will be updated in the next update loop.

Returns

The value of the attribute (Any)

class omni.graph.core.AttributeData
copy_data(self: omni.graph.core._omni_graph_core.AttributeData, rhs: omni.graph.core._omni_graph_core.AttributeData)bool

Copies the og.AttributeData data into this object’s data.

Parameters

rhs (og.AttributeData) – Attribute data to be copied - must be the same type as the current object to work

Returns

True if the data was successfully copied, else False.

Return type

(bool)

cpu_valid(self: omni.graph.core._omni_graph_core.AttributeData)bool

Returns whether this attribute data object is currently valid on the cpu.

Returns

Is the attribute data currently valid on the cpu?

Return type

[bool]

get(self: omni.graph.core._omni_graph_core.AttributeData, on_gpu: bool = False)object
Parameters

on_gpu (bool) – Is the data to be retrieved from the GPU?

Returns

Value of the attribute data

Return type

(Any)

get_array(self: omni.graph.core._omni_graph_core.AttributeData, on_gpu: bool = False, get_for_write: bool, reserved_element_count: int)object
Parameters
  • on_gpu (bool) – Is the data to be retrieved from the GPU?

  • get_for_write (bool) – Should the data be retrieved for writing?

  • reserved_element_count (int) – If the data is to be retrieved for writing, preallocate this many elements

Returns

Value of the attribute’s data

Return type

(Any)

get_extended_type(self: omni.graph.core._omni_graph_core.AttributeData)omni.graph.core._omni_graph_core.ExtendedAttributeType

Returns the extended type of the current attribute data.

Returns

Extended type of the attribute data object

Return type

[omni.graph.core.ExtendedAttributeType]

get_name(self: omni.graph.core._omni_graph_core.AttributeData)str

Returns the name of the current attribute data.

Returns

Name of the attribute data object

Return type

[str]

get_resolved_type(self: omni.graph.core._omni_graph_core.AttributeData)omni.graph.core._omni_graph_core.Type

Returns the resolved type of the extended attribute data. Only valid for attributes with union/any extended types.

Returns

Resolved type of the attribute data object

Return type

[omni.graph.core.Type]

get_type(self: omni.graph.core._omni_graph_core.AttributeData)omni.graph.core._omni_graph_core.Type

Returns the type of the current attribute data.

Returns

Type of the attribute data object

Return type

[omni.graph.core.Type]

property gpu_ptr_kind

Defines the memory space that GPU array data pointers live in

gpu_valid(self: omni.graph.core._omni_graph_core.AttributeData)bool

Returns whether this attribute data object is currently valid on the gpu.

Returns

Is the attribute data currently valid on the gpu?

Return type

[bool]

is_read_only(self: omni.graph.core._omni_graph_core.AttributeData)bool

Returns whether this attribute data object is read only or not.

Returns

Is the attribute data object read-only?

Return type

[bool]

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

Returns whether this attribute data object is valid or not.

Returns

Is the attribute data object valid?

Return type

[bool]

references_same_data(self: omni.graph.core._omni_graph_core.AttributeData, rhs: omni.graph.core._omni_graph_core.AttributeData)bool

Checks to see if two attribute data values point to the same underlying data.

Parameters

rhs (og.AttributeData) – Attribute data whose location is to be compared

Returns

True if the two attribute data values point to the same underlying data.

Return type

(bool)

resize(self: omni.graph.core._omni_graph_core.AttributeData, arg0: int)bool

Sets the size of the array represented by this object.

Returns

True if the array was resized, False if the attribute data was not an array

Return type

[bool]

set(self: omni.graph.core._omni_graph_core.AttributeData, value: object, on_gpu: bool = False)bool

Sets the value of the attribute data

Parameters
  • value (Any) – New value of the attribute data

  • on_gpu (bool) – Is the data to be set on the GPU?

Returns

True if the value was successfully set

Return type

(bool)

size(self: omni.graph.core._omni_graph_core.AttributeData)int

Returns the size of the data represented by this object (1 if it’s not an array).

Returns

Number of elements in the data

Return type

[int]

class omni.graph.core.AttributeDataValueHelper(data: Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute, omni.graph.core._omni_graph_core.AttributeData])

Class to manage getting and setting of og.AttributeData values.

Note that this helper sets values directly and is not generally advised for use as it has no undo support. Instead you probably want to use og.Controller or og.DataView

Internal Attributes:

__data: The interface to the attribute data __type: The attribute type of the data (delay loaded to allow for extended types needing resolution)

property attribute_data

Returns the attribute data this helper is wrapping

check_validity()

Raises an og.OmniGraphError exception if the data about to be accessed is invalid

get(on_gpu: bool = False, reserved_element_count: Optional[int] = None, return_type: Optional[omni.graph.core._impl.attribute_values.WrappedArrayType] = None)Any

Get the value of this attribute data.

Parameters
  • on_gpu – Is the value stored on the GPU?

  • reserved_element_count – For array attributes, if not None then the array will pre-reserve this many elements

  • return_type – For array attributes this specifies how the return data is to be wrapped

Returns

Value of the attribute data

Raises
  • AttributeError – If reserved_element_count or return_type are defined but the attribute is not an array type

  • TypeError – Raised if the data type is not yet supported or the attribute type is not resolved

get_array(get_for_write: bool, reserved_element_count: int = 0, on_gpu: bool = False, return_type: Optional[omni.graph.core._impl.attribute_values.WrappedArrayType] = None)Any

Deprecated - use get()

get_array_size()int

Get the length of this attribute data’s array.

Returns

Length of the data array in FlatCache

Raises

AttributeError – If the array is not an array type

property gpu_ptr_kind

Returns the location of pointers to GPU arrays

property is_resolved

Returns whether the underlying API object has a resolved type.

property is_valid

Returns whether the underlying API object is valid or not

reserve_element_count(new_element_count: int)

Set the length of this attribute data’s array. It doesn’t matter whether the data will be on the GPU or CPU, all this does is reserve the size number. When retrieving the data you will specify where it lives.

Parameters

new_element_count – Number of array elements to reserve for the array

Raises

AttributeError – If the array is not an array type

set(new_value: Union[Any, omni.graph.core._impl.utils.TypedValue], on_gpu: bool = False)

Set the value of AttributeData

Parameters
  • new_value – New value to be set on the attribute

  • on_gpu – Should the value be stored on the GPU?

Raises

TypeError – Raised if the data type of the attribute is not yet supported

property type

Returns the attribute type, extracting it from the data if it hasn’t already been done

class omni.graph.core.AttributePortType

Members:

ATTRIBUTE_PORT_TYPE_INPUT

ATTRIBUTE_PORT_TYPE_OUTPUT

ATTRIBUTE_PORT_TYPE_STATE

ATTRIBUTE_PORT_TYPE_UNKNOWN

ATTRIBUTE_PORT_TYPE_INPUT = AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT
ATTRIBUTE_PORT_TYPE_OUTPUT = AttributePortType.ATTRIBUTE_PORT_TYPE_OUTPUT
ATTRIBUTE_PORT_TYPE_STATE = AttributePortType.ATTRIBUTE_PORT_TYPE_STATE
ATTRIBUTE_PORT_TYPE_UNKNOWN = AttributePortType.ATTRIBUTE_PORT_TYPE_UNKNOWN
property name

handle) -> str

Type

(self

class omni.graph.core.AttributeRole

Members:

APPLIED_SCHEMA

BUNDLE

COLOR

EXECUTION

FRAME

MATRIX

NONE

NORMAL

OBJECT_ID

PATH

POSITION

PRIM_TYPE_NAME

QUATERNION

TEXCOORD

TEXT

TIMECODE

TRANSFORM

VECTOR

UNKNOWN

APPLIED_SCHEMA = AttributeRole.APPLIED_SCHEMA
BUNDLE = AttributeRole.BUNDLE
COLOR = AttributeRole.COLOR
EXECUTION = AttributeRole.EXECUTION
FRAME = AttributeRole.FRAME
MATRIX = AttributeRole.MATRIX
NONE = AttributeRole.NONE
NORMAL = AttributeRole.NORMAL
OBJECT_ID = AttributeRole.OBJECT_ID
PATH = AttributeRole.PATH
POSITION = AttributeRole.POSITION
PRIM_TYPE_NAME = AttributeRole.PRIM_TYPE_NAME
QUATERNION = AttributeRole.QUATERNION
TEXCOORD = AttributeRole.TEXCOORD
TEXT = AttributeRole.TEXT
TIMECODE = AttributeRole.TIMECODE
TRANSFORM = AttributeRole.TRANSFORM
UNKNOWN = AttributeRole.UNKNOWN
VECTOR = AttributeRole.VECTOR
property name

handle) -> str

Type

(self

class omni.graph.core.AttributeType
static base_data_size(type: omni.graph.core._omni_graph_core.Type)int

Figure out how much space a base data type occupies in memory inside FlatCache. This will not necessarily be the same as the space occupied by the Python data, which is only transient. Multiply by the tuple count and the array element count to get the full size of any given piece of data.

Parameters

arg0 (og.Type) – The type object whose base data type size is to be found

Returns

Number of bytes one instance of the base data type occupies in FlatCache

Return type

(int)

Check to see if the type combination has a legal representation in OGN.

Parameters

arg0 (og.Type) – The type object to be checked

Returns

True if the type represents a legal OGN type, otherwise False

Return type

(bool)

static sdf_type_name_from_type(type: omni.graph.core._omni_graph_core.Type)object

Given an attribute type find the corresponding SDF type name for it, None if there is none, e.g. a ‘bundle’

Parameters

arg0 (omni.graph.core.Type) – The type to be converted

Returns

The SDF type name of the type, or None if there is no corresponding SDF type

Return type

(str)

static type_from_ogn_type_name(ogn_type_name: str)omni.graph.core._omni_graph_core.Type

Parse an OGN attribute type name into the corresponding omni.graph.core.Type description.

Parameters

arg0 (str) – The OGN-style attribute type name to be converted

Returns

Type corresponding to the attribute type name in OGN format. Type object will be the unknown type if the type name could be be parsed.

Return type

(omni.graph.core.Type)

static type_from_sdf_type_name(sdf_type_name: str)omni.graph.core._omni_graph_core.Type

Parse an SDF attribute type name into the corresponding omni.graph.core.Type description. Note that SDF types are not capable of representing some of the valid types - use typeFromOgnTypeName() for a more comprehensive type name description.

Parameters

arg0 (str) – The SDF-style attribute type name to be converted

Returns

Type corresponding to the attribute type name in SDF format. Type object will be the unknown type if the type name could be be parsed.

Return type

(omni.graph.core.Type)

class omni.graph.core.AttributeValueHelper(attribute: omni.graph.core._omni_graph_core.Attribute)

Class to manage getting and setting of og.Attribute values. You can also just use AttributeDataValueHelper directly.

property attribute

Returns the attribute this helper is wrapping

property is_resolved

Returns whether the underlying attribute has a resolved type.

property is_valid

Returns whether the underlying API object is valid or not

resolve_type(type_id: Union[str, omni.graph.core._omni_graph_core.Type])

Resolves the attribute type, usually before setting an explicit value.

Parameters

type – Attribute type to which the attribute will be resolved.

Raises

og.OmniGraphError – If the attribute could not (or should not) be resolved

set(new_value: Union[Any, omni.graph.core._impl.utils.TypedValue], on_gpu: bool = False, update_usd: bool = False)

Set the value of the attribute. This is overridden so that it can include an explicit type for the data, which can be used to resolve the attribute type (only valid for extended types)

Parameters
  • new_value – New value to be set on the attribute

  • on_gpu – Should the value be stored on the GPU?

  • update_usd – Should the value be immediately propagated to USD?

Raises

TypeError – Raised if the data type of the attribute is not yet supported

omni.graph.core.AutoClass(**kwargs)
omni.graph.core.AutoFunc(**kwargs)
class omni.graph.core.AutoNodeDefinitionGenerator

Defines an interface for generating a node definition

abstract classmethod generate_from_definitions(new_type: type)Tuple[Iterable[omni.graph.core._impl.autonode.type_definitions.AutoNodeDefinitionWrapper], Iterable[str]]

This method scans the type new_type and outputs an AutoNodeDefinitionWrapper from it, representing the type, as well as a list of members it wishes to hide from the rest of the node extraction process.

Parameters

new_type – the type to analyze by attribute

Returns: a tuple of:

Iterable[AutoNodeDefinitionWrapper] - an iterable of AutoNodeDefinitionWrapper - every node wrapper that is generated from this type. Iterable[str] - an iterable of all members covered by this handler that other handlers should ignore.

classmethod name()
class omni.graph.core.AutoNodeDefinitionWrapper

Container for a single node representation consumed by the Ogn code generator. Class is abstract and meant to be overridden. A sufficient implementation overrides these methods: * get_ogn(self) -> Dict * get_node_impl(self) * get_unique_name(self) -> str * get_module_name(self) -> str

abstract get_module_name()str

Get the module this autograph method was defined in.

Returns

the module name

abstract get_node_impl()

Returns the Ogn class implementing the node behavior. See omnigraph docuemntation on how to implement. A sufficient implementation contains a staticmethod with the function: compute(db)

abstract get_ogn()Dict

Get the Ogn dictionary representation of the node interface.

abstract get_unique_name()str

Get nodes unique name, to be saved as an accessor in the node database.

Returns

the non-manlged unique name

class omni.graph.core.AutoNodeTypeConversion

Static class for storing conversion methods between python types and Omnigraph types

class Method(value)

An enumeration.

ASSIGN = (0,)
MODIFY = 1
classmethod from_ogn_type(og_type: str)Optional[omni.graph.core._impl.autonode.type_definitions.TypeDesc]

Searches the conversion registry using an Omnigraph type. Searches the user types first, defaults to the system types.

Parameters

og_type – string representing the incoming ogn type

Returns

TypeDesc for the found python type if it’s found, None otherwise

classmethod from_type(type_desc: type)Optional[omni.graph.core._impl.autonode.type_definitions.TypeDesc]

Searches the conversion registry using a python type.

Parameters

type_desc – python type to convert

Returns

TypeDesc for the found python type if it’s found, None otherwise

classmethod register_type_conversion(python_type: type, ogn_typename: str, python_to_ogn: Optional[Callable] = None, python_to_ogn_method: omni.graph.core._impl.autonode.type_definitions.AutoNodeTypeConversion.Method = <Method.ASSIGN: (0, )>, ogn_to_python: Optional[Callable] = None, ogn_to_python_method: omni.graph.core._impl.autonode.type_definitions.AutoNodeTypeConversion.Method = <Method.ASSIGN: (0, )>, default=None)

Registers a type conversion between a python type and an ogn type. Masks any existing system setting. If a previous user-submitted type conversion is registered, it will be overridden.

Parameters
  • python_type – the type representation in python.

  • ogn_typename – string representation of the ogn type. Node generation will fail if the type isn’t recognized by ogn.

  • python_to_ogn – [optional] function to convert a python return value to an OGN struct. Signature is Callable[[[python_type], object]. Defaults to None

  • ogn_to_python – [optional] function to convert an OGN struct to a python return value. Signature is Callable[[[object], python_type]. Defaults to None

types = [TypeDesc(type=<class 'bool'>, og_type='bool', type_to_og=<class 'bool'>, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=False), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='colord[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='colorf[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='colorh[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='colord[4]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='colorf[4]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='colorh[4]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='double', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=0), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='double[2]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='double[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='double[4]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0, 0)), TypeDesc(type=<class 'float'>, og_type='double', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=0), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='float', type_to_og=<class 'float'>, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=0), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='float[2]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='float[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='float[4]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='half', type_to_og=<class 'numpy.float16'>, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=0), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='half[2]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='half[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='half[4]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0, 0)), TypeDesc(type=<class 'int'>, og_type='int64', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=0), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='int', type_to_og=<function int_to_int32>, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=0), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='int[2]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='int[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='int[4]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='matrixd[2]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=((1, 0), (0, 1))), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='matrixd[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=((1, 0, 0), (0, 1, 0), (0, 0, 1))), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='matrixd[4]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=((1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1))), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='normald[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='normalf[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='normalh[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='pointd[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='pointf[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='pointh[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='quatd[4]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='quatf[4]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='quath[4]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0, 0)), TypeDesc(type=<class 'str'>, og_type='string', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=''), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='texcoordd[2]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='texcoordf[2]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='texcoordh[2]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='texcoordd[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='texcoordf[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='texcoordh[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='timecode', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=0), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='token', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=0), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='uint', type_to_og=<function int_to_uchar>, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=0), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='uchar', type_to_og=<function int_to_uchar>, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=0), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='vectord[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='vectorf[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0)), TypeDesc(type=<function NewType.<locals>.new_type>, og_type='vectorh[3]', type_to_og=None, type_to_og_conversion_method=<Method.ASSIGN: (0,)>, og_to_type=None, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=(0, 0, 0))]
classmethod unregister_type_conversion(python_type: Optional[type] = None, ogn_type_name: Optional[str] = None)Optional[omni.graph.core._impl.autonode.type_definitions.TypeDesc]

Unregisters a type conversion from python to ogn. Doesn’t unregister system types.

Parameters
  • python_type – the python type to be removed from support

  • ogn_type_name – the ogn type name type to be removed from support

Returns

The TypeDesc tuple just unregistered, or none.

user_types = [TypeDesc(type=<class 'omni.graph.core._impl.bundles.Bundle'>, og_type='bundle', type_to_og=<function Bundle.commit_to_graph_bundle_contents>, type_to_og_conversion_method=<Method.MODIFY: 1>, og_to_type=<bound method Bundle.from_accessor of <class 'omni.graph.core._impl.bundles.Bundle'>>, og_to_type_conversion_method=<Method.ASSIGN: (0,)>, default=None)]
class omni.graph.core.BaseDataType

Members:

ASSET

BOOL

CONNECTION

DOUBLE

FLOAT

HALF

INT

INT64

PRIM

RELATIONSHIP

TAG

TOKEN

UCHAR

UINT

UINT64

UNKNOWN

ASSET = BaseDataType.ASSET
BOOL = BaseDataType.BOOL
CONNECTION = BaseDataType.CONNECTION
DOUBLE = BaseDataType.DOUBLE
FLOAT = BaseDataType.FLOAT
HALF = BaseDataType.HALF
INT = BaseDataType.INT
INT64 = BaseDataType.INT64
PRIM = BaseDataType.PRIM
RELATIONSHIP = BaseDataType.RELATIONSHIP
TAG = BaseDataType.TAG
TOKEN = BaseDataType.TOKEN
UCHAR = BaseDataType.UCHAR
UINT = BaseDataType.UINT
UINT64 = BaseDataType.UINT64
UNKNOWN = BaseDataType.UNKNOWN
property name

handle) -> str

Type

(self

class omni.graph.core.Bundle(attribute_name: str, read_only: bool)

Deferred implementation of the bundle concept

attribute_by_name(attribute_name: str)Optional[omni.graph.core._impl.runtime.RuntimeAttribute]

Get an attribute by name from the underlying buffer or the buffer masking it.

Parameters

attribute_name – the attribute being queried.

Returns

the named attribute within the bundle, or None if no such attribute exists in the bundle

property attribute_names

Returns the list of interface objects corresponding to the attributes contained within the bundle

clear()

Empties out the bundle contents

Raises

og.OmniGraphError if the bundle is not writable

static commit_to_graph_bundle_contents(source: omni.graph.core._impl.bundles.Bundle, bundle_contents: omni.graph.core._impl.bundles.BundleContents)

——– FOR GENERATED CODE USE ONLY ——– Copy all attributes from the buffer to the runtime BundleContents class.

Parameters
  • source – the Bundle object to be copied

  • bundle_contents – the BundleContets object to be copied into into

create_attribute(name: str, type_desc: type)omni.graph.core._impl.bundles.OmniAttribute

Create an attribute inside the buffered bundle data structure

Parameters
  • name – name of the attribute to create

  • type_desc – python type object of the attribute to create. Accepts all Omnigraph types. Will attempt to convert non-omnigraph types, but raise an error if it fails.

Returns

the OmniAttribute it created.

Raises

OmniGraphError if no type conversion was found.

classmethod from_accessor(bundle_contents: omni.graph.core._impl.bundles.BundleContents)

——– FOR GENERATED CODE USE ONLY ——– Convert a BundleContents object to a python Bundle.

Parameters

bundle_contents – the graph object representing the bundle

insert(to_insert: Union[omni.graph.core._impl.bundles.Bundle, omni.graph.core._impl.bundles.OmniAttribute, Tuple[omni.graph.core._impl.bundles.OmniAttribute, str], Tuple[omni.graph.core._omni_graph_core.Type, str]])

Insert new content in the existing bundle

Parameters

to_insert – Object to insert. It can be one of three different types of object: Bundle: Another bundle, whose contents are entirely copied into this one RuntimeAttribute: A single attribute from another bundle to be copied with the same name (RuntimeAttribute, str): A single attribute from another bundle and the name to use for the copy AttributeDescription: Information required to create a brand new typed attribute

Returns

Attribute object of the new attribute if inserting an attribute, else None

property is_runtime_resident
property name

The bundle’s name

remove(attribute_name: str)

Removes the attribute with the given name from the bundle, silently succeeding if it is not in the bundle.

Parameters

attribute_name – attribute to be deleted.

property runtime_accessor

exposes the runtime bundle accessor.

Returns

the BundleContents object if it exists, None otherwise.

property size

Returns the number of attributes within this bundle, 0 if the bundle is not valid

property valid

Returns: True if the underlying bundle is valid, False if the underlying bundle is not valid, None if the

class omni.graph.core.BundleContainer(context: omni.graph.core._omni_graph_core.GraphContext, node: omni.graph.core._omni_graph_core.Node, attributes, gpu_bundles: List[str], read_only: bool = False)

——– FOR GENERATED CODE USE ONLY ——–

Simple container to manage the set of bundle objects used during a compute function by a node. This is initialized alongside attribute data in order to minimize the generated code. It will house a set of BundleContents objects, one per attribute that is a bundle type, with properties named after the attributes they represent

Parameters
  • context – Evaluation context for these bundles

  • node – Owner of these bundles

  • attributes – Subset of node attributes to check for being bundles

  • gpu_bundles – Subset of bundle attributes whose memory lives on the GPU

  • read_only – True if these attributes are read-only

class omni.graph.core.BundleContents(context: omni.graph.core._omni_graph_core.GraphContext, node: omni.graph.core._omni_graph_core.Node, attribute_name: str, read_only: bool, gpu_by_default: bool)

Manage the allowed types of attributes, providing a static set of convenience values

Internal Attributes:

__bundle: The bundle attached to the attribute __gpu_by_default: Are the bundle members on the GPU by default?

Properties:

context: Evaluation context from which this bundle was extracted read_only: Is the bundle data read-only?

add_attributes(types: List[omni.graph.core._omni_graph_core.Type], names: List[str])

Add attributes to the bundle

Parameters
  • types – Vector of types

  • names – The names of each attribute

  • it is required that size (Note) –

Returns

nope

attribute_by_name(attribute_name: str)Optional[omni.graph.core._impl.runtime.RuntimeAttribute]

Returns the named attribute within the bundle, or None if no such attribute exists in the bundle

property attributes

Returns the list of interface objects corresponding to the attributes contained within the bundle

property bundle

Returns the bundle being wrapped by this object

clear()

Empties out the bundle contents

Raises

og.OmniGraphError if the bundle is not writable

insert(to_insert: Union[omni.graph.core._impl.bundles.BundleContents, omni.graph.core._impl.runtime.RuntimeAttribute, Tuple[omni.graph.core._impl.runtime.RuntimeAttribute, str], Tuple[omni.graph.core._omni_graph_core.Type, str]])omni.graph.core._impl.runtime.RuntimeAttribute

Insert new content in the existing bundle

Parameters

to_insert – Object to insert. It can be one of three different types of object: Bundle: Another bundle, whose contents are entirely copied into this one RuntimeAttribute: A single attribute from another bundle to be copied with the same name (RuntimeAttribute, str): A single attribute from another bundle and the name to use for the copy AttributeDescription: Information required to create a brand new typed attribute

Returns

RuntimeAttribute of the new attribute if inserting an attribute, else None

property path

Returns the path where this bundle’s data is stored

remove(attribute_name: str)

Removes the attribute with the given name from the bundle, silently succeeding if it is not in the bundle

remove_attributes(names: List[str])

Remove attributes from the bundle

Parameters
  • names – The names of each attribute to be removed

  • it is required that size (Note) –

Returns

nope

property size

Returns the number of attributes within this bundle, 0 if the bundle is not valid

property valid

Returns true if the underlying bundle is valid, else false

omni.graph.core.Color3d(x)
omni.graph.core.Color3f(x)
omni.graph.core.Color3h(x)
omni.graph.core.Color4d(x)
omni.graph.core.Color4f(x)
omni.graph.core.Color4h(x)
class omni.graph.core.ComputeGraph
omni.graph.core.ConnectAttrsCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.ConnectPrimCommand(*args, **kwargs)

Redirect function calls to the real class

class omni.graph.core.ConnectionInfo
property attr
property connection_type
class omni.graph.core.ConnectionType

Members:

CONNECTION_TYPE_REGULAR

CONNECTION_TYPE_DATA_ONLY

CONNECTION_TYPE_EXECUTION

CONNECTION_TYPE_DATA_ONLY = ConnectionType.CONNECTION_TYPE_DATA_ONLY
CONNECTION_TYPE_EXECUTION = ConnectionType.CONNECTION_TYPE_EXECUTION
CONNECTION_TYPE_REGULAR = ConnectionType.CONNECTION_TYPE_REGULAR
property name

handle) -> str

Type

(self

class omni.graph.core.ContextHelper(py_context=None)

Helper class for managing compute graph contexts

_py_context

Context on which to apply the operations

property context

Returns the context being used for evaluation

get(object: Union[omni.graph.core._omni_graph_core.Attribute, omni.graph.core._omni_graph_core.AttributeData], on_gpu: bool = False, update_immediately: bool = False)

Get the value of an attribute or attribute data. Can be used for either type.

This method is intended for simple value retrievals. For array values use get_array().

Parameters
  • object – attribute data whose value is to be retrieved

  • on_gpu – Is the value stored on the GPU?

  • update_immediately – Should the stage update before getting the value or wait for the next regular update?

Returns

Value of the attribute or attribute data

Raises

TypeError – If an unsupported object type was passed in

get_array(object: Union[omni.graph.core._omni_graph_core.Attribute, omni.graph.core._omni_graph_core.AttributeData], on_gpu: bool = False, update_immediately: bool = False, get_for_write: bool = False, reserved_element_count: int = 0, return_type: Optional[omni.graph.core._impl.attribute_values.WrappedArrayType] = None)Any

Get the value of an attribute or attribute data. Can be used for either type.

Parameters
  • object – attribute whose value is to be retrieved

  • on_gpu – Is the value stored on the GPU?

  • update_immediately – Should the stage update before getting the value or wait for the next regular update?

  • get_for_write – If True then get the data in writable form (which may do other things under the covers)

  • reserved_element_count – For writable array types set the element count to this before retrieving the data. This guarantees a buffer of this many elements is available in the returned data.

Returns

Array value of the attribute or attribute data

Raises

TypeError – If an unsupported object type was passed in

get_attr_value(attr: omni.graph.core._omni_graph_core.Attribute, isGPU: bool = False, isTensor: bool = False, getDefault: bool = False, updateImmediately=False, getForWrite=False, writeElemCount=0)

Get the value of a node attribute in the context managed by this class.

Parameters
  • attr – attribute whose value is to be retrieved

  • isGPU – Is the attribute stored on the GPU?

  • isTensor – Is the attribute value a tensor type? For some types of data this doesn’t mean anything but is silently accepted anyway.

  • isDefault – Whether or not we want to retrieve the default value

  • updateImmediately – Should the stage update immediately or wait for the next regular update?

  • getForWrite – Is the value going to be written to after calling?

  • writeElemCount – If the value to get is a writable array then set it at this size

Returns

Value of the attribute

Raises
  • AttributeError – If you try to access array data with “isTensor=True” and torch was not imported

  • TypeError – Raised if the data type of the attribute is not yet supported

get_attribute_configuration(attr: Union[omni.graph.core._omni_graph_core.Attribute, omni.graph.core._omni_graph_core.AttributeData])

Get the array configuration information from the attribute.

Attributes can be simple, tuples, or arrays of either. The information on what this is will be encoded in the attribute type name. This method decodes that type name to find out what type of attribute data the attribute will use.

The method also gives the right answers for both Attribute and AttributeData with some suitable AttributeError catches to special case on unimplemented methods.

Parameters

attr – Attribute whose configuration is being determined

Returns

str: Name of the full/resolved data type used by the attribute (e.g. “float[3][]”) str: Name of the simple data type used by the attribute (e.g. “float”) bool: True if the data type is a tuple or array (e.g. “float3” or “float[]”) bool: True if the data type is a matrix and should be flattened (e.g. “matrixd[3]” or “framed[4][]”) List: List of lookup methods for this type

Return type

Tuple of

Raises

TypeError – If the attribute type is not yet supported

get_elem_count(attr)
Get the number of elements on the attribute in the context managed by this class

attr: Attribute whose element values are to be counted

Returns

Number of elements currently on the attribute

set_attr_value(new_value, attr: omni.graph.core._omni_graph_core.Attribute)
Set the value of a attribute in the context managed by this class

new_value: New value to be set on the attribute attr: Attribute whose value is to be set

Raises

TypeError – Raised if the data type of the attribute is not yet supported or if the parameters were passed in the wrong order.

class omni.graph.core.Controller(*args, **kwargs)

Class to provide a simple interface to a variety OmniGraph manipulation functions.

Provides functions for creating nodes, making and breaking connections, and setting values. Graph manipulation functions are undoable, value changes are not.

Functions are set up to be as flexible as possible, accepting a wide variety of argument variations. Most functions are class methods, though return values can be retained for passing in to other functions (e.g. the edit() function returns a list of graphs that can later be passed in to the evaluate() function to ensure all related graphs upate).

The one exception is the edit() function, which is a regular method as it needs to retain state information. See its description for more details.

Here is a summary of the interface methods you can access through this class, grouped by interface class

Controller

edit Perform a collection of edits on a graph (the union of all interfaces) async evaluate Runs evaluation on one or more graphs as a waitable (typically called from async tests) evaluate_sync Runs evaluation on one or more graphs immediately

ObjectLookup

attribute Looks up an og.Attribute from a description attribute_path Looks up an attribute string path from a description attribute_type Looks up an og.Type from a description graph Looks up an og.Graph from a description node Looks up an og.Node from a description node_path Looks up a node string path from a description prim Looks up an Usd.Prim from a description prim_path Looks up a Usd.Prim string path from a description split_graph_from_node_path Separate a graph and a relative node path from a full node path

GraphController

connect Makes connections between attribute pairs create_node Creates a new og.Node create_prim Creates a new Usd.Prim create_variable Creates a new og.IVariable delete_node Deletes a list of og.Nodes disconnect Breaks connections between attribute pairs disconnect_all Breaks all connections to and from specific attributes expose_prim Expose a USD prim to OmniGraph through an importing node

NodeController

create_attribute Create a new dynamic attribute on a node remove_attribute Remove an existing dynamic attribute from a node safe_node_name Get a node name in a way that’s safe for USD

DataView

get Get the value of an attribute’s data get_array_size Get the number of elements in an array attribute’s data set Set the value of an attribute’s data

Class Attributes:

class Keys: Helper for managing the keywords needed for the edit() function

__path_to_object_map

Mapping from the node or prim path specified to the created node or prim

Raises

OmniGraphError – If the requested operation could not be performed

DUAL_METHODS = {'edit': '_cls_edit'}

Names of methods shared as both class and object methods, mapped to the classmethod implementation

Keys

alias of omni.graph.tools.node_generator.keys.GraphSetupKeys

PrimCreationData_t

alias of Union[Tuple[Union[str, pxr.Sdf.Path], Dict[str, Tuple[Union[str, omni.graph.core._omni_graph_core.Type], Any]]], Tuple[Union[str, pxr.Sdf.Path], str], Tuple[Union[str, pxr.Sdf.Path], Dict[str, Tuple[Union[str, omni.graph.core._omni_graph_core.Type], Any]], str]]

TYPE_CHECKING = True

If True then verbose type checking will happen in various locations so that more legible error messages can be emitted. Set it to False to run a little bit faster, with errors just reporting raw Python error messages.

edit(graph_id: Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph, Dict[str, Any]], edit_commands: Dict[str, Any] = {})Tuple[omni.graph.core._omni_graph_core.Graph, List[omni.graph.core._omni_graph_core.Node], List[pxr.Usd.Prim], Dict[str, Union[omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim]]]

Edit and/or create an OmniGraph from the given description.

This function provides a single call that will make a set of modifications to an OmniGraph. It can be used to create a new graph from scratch or to make changes to an existing graph.

A single undo will revert everything done via this call.

The description contains different sections that perform different operations on the graph. They are always done in a specific order to minimize conflicts. If you need to execute them in a different order then use multiple calls to edit().

Here is the list of the allowed operations, in the order in which they will be performed.

The parameters are described as lists, though if you have only one parameter for a given operation you can pass it without it being in a list.

For brevity the shortcut “keys = og.Controller.Keys” is assumed to exist.

  • graph_id

    If a string then it represents the path to the new (or existing) graph. If a dictionary then these are the key:value pairs it accepts:

    “graph_path”: Full path to the graph prim to be created to house the OmniGraph “evaluator_name”: Type of evaluator the graph should use (default “push”) “fc_backing_type”: og.GraphBackingType that tells you what kind of FlatCache to use for graph data (default og.GraphBackingType.GRAPH_BACKING_TYPE_FLATCACHE_SHARED) “pipeline_stage”: og.GraphPipelineStage that tells you which pipeline stage this graph fits into (default og.GraphPipelineStage.GRAPH_PIPELINE_STAGE_SIMULATION)

  • keys.DELETE_NODES: NodeSpecs_t

    Deletes a node or list of nodes. If the node specification is a relative path then it must be in the list of full paths that the controller created in a previous call to edit().

    { keys.DELETE_NODES: [“NodeInGraph”, “/Some/Other/Graph/Node”, my_omnigraph_node] }

  • keys.CREATE_NODES: [(Path_t, NodeType_t)]

    Constructs a node of the given type at the given path. If the path is a relative one then it is added directly under the graph being edited. A map is remembered between the given path, relative or absolute, and the node created at it so that further editing functions can refer to the node by that name directly rather than trying to infer the final full name.

    { keys.CREATE_NODES: [(“NodeInGraph”, “omni.graph.tutorial.SimpleData”),

    (“Inner/Node/Path”, og.NodeType(node_type_name))] }

  • keys.CREATE_PRIMS: [(Path_t, {ATTR_NAME: (AttributeType_t, ATTR_VALUE)}, Optional(PRIM_TYPE))]

    Constructs a prim at path “PRIM_PATH” containing a set of attributes with specified types and values. Only those attribute types supported by USD can be used here, though the type specification can be in OGN form - invalid types result in an error. Whereas relative paths on nodes are treated as being relative to the graph, for prims a relative path is relative to the stage root. Prims are not allowed inside an OmniGraph and attempts to create one there will result in an error.

    Note that the PRIM_TYPE can appear with or without an attribute definition. (Many prim types are part of a schema and do not require explicit attributes to be added.)

    { keys.PRIMS: [(“/World/Prim”, {“speed”: (“double”, 1.0)}),

    (“/World/Cube”, “Cube”), (“RootPrim”, {“mass”: (Type(BaseDataType.DOUBLE), 3.0), “force:gravity”: (“double”, 32.0) })

  • keys.CONNECT: [(AttributeSpec_t, AttributeSpec_t)]

    Makes a connection between the given source and destination attributes. The local name of a newly created node may be made as part of the node in the spec, or the node portion of the attribute path:

    { keys.CONNECT: [(“NodeInGraph.outputs:value”, (“inputs:value”, “NodeInGraph”))]}

  • keys.DISCONNECT: [(AttributeSpec_t, AttributeSpec_t)]

    Breaks a connection between the given source and destination attributes. The local name of a newly created node may be made as part of the node in the spec, or the node portion of the attribute path:

    { keys.DISCONNECT: [(“NodeInGraph.outputs:value”, (“inputs:value”, “NodeInGraph”))]}

  • keys.EXPOSE_PRIMS: [(cls.PrimExposureType, Prim_t, NewNode_t)]

    Exposes a prim to OmniGraph through creation of one of the node types designed to do that. The first member of the tuple is the method used to expose the prim. The prim path is the second member of the tuple and it must already exist in the USD stage. The third member of the tuple is a node name with the same restrictions as the name in the CREATE_NODES edit.

    { keys.EXPOSE_PRIMS: [(cls.PrimExposureType.AS_BUNDLE, “/World/Cube”, “BundledCube”)] }

  • keys.SET_VALUES: [AttributeSpec_t, Any] or [AttributeSpec_t, Any, AttributeType_t]

    Sets the value of the given list of attributes.

    { keys.SET_VALUES[(“/World/Graph/Node.inputs:attr1”, 1.0), ((“inputs:attr2”, node), 2.0)] }

    In the case of extended attribute types you may also need to supply a data type, which is the type the attribute will resolve to when the value is set. To supply a type, add it as a third parameter to the attribute value:

    { keys.SET_VALUES[(“inputs:ext1”, node), 2.0, “float”] }

  • keys.CREATE_VARIABLES: [(VariableName_t, VariableType_t)]

    Constructs a variable on the graph with the given name and type. The type can be specified as either a ogn type string (e.g. “float4”), or as an og.Type (e.g. og.Type(og.BaseDataType.FLOAT))

    { keys.CREATE_VARIABLES[(“velocity”, “float3”), (“count”, og.Type(og.BaseDataType.INT))] }

Here’s a simple call that first deletes an existing node “/World/PushGraph/OldNode”, then creates two nodes of type “omni.graph.tutorials.SimpleData”, connects their “a_int” attributes, disconnects their “a_float” attributes and sets the input “a_int” of the source node to the value 5. It also creates two unused USD Prim nodes, one with a float attribute named “attrFloat” with value 2.0, and the other with a boolean attribute named “attrBool” with the value true.

controller = og.Controller()
keys = og.Controller.Keys
(graph, nodes_constructed, prims_constructed, path_to_object_map) = controller.edit("/World/PushGraph", {
    keys.DELETIONS: [
        "OldNode"
    ],
    keys.CREATE_NODES: [
        ("src", "omni.graph.tutorials.SimpleData"),
        ("dst", "omni.graph.tutorials.SimpleData")
        ],
    keys.CREATE_PRIMS: [
        ("Prim1", {"attrFloat": ("float", 2.0)),
        ("Prim2", {"attrBool": ("bool", true)),
        ],
    keys.CONNECT: [
        ("src.outputs:a_int", "dst.inputs:a_int")
        ],
    keys.DISCONNECT: [
        ("src.outputs:a_float", "dst.inputs:a_float")
        ],
    keys.SET_VALUES: [
        ("src.inputs:a_int", 5)
        ]
    keys.CREATE_VARIABLES: [
        ("a_float_var", og.Type(og.BaseDataType.FLOAT)),
        ("a_bool_var", "bool")
    ]
    }
)

Note

The controller object remembers where nodes are created so that you can use short forms for the node paths for convenience. That’s why in the above graph the node paths for creation and the node specifications in the connections just says “src” and “dst”. As they have no leading “/” they are treated as being relative to the graph path and will actually end up in “/World/PushGraph/src” and “/World/PushGraph/dst”.

Node specifications with a leading “/” are assumed to be absolute paths and must be inside the path of an existing or created graph. e.g. the NODES reference could have been “/World/PushGraph/src”, however using “/src” would have been an error.

This node path mapping is remembered across multiple calls to edit() so you can always use the shortform so long as you use the same Controller object.

Parameters
  • graph_id – Identifier that says which graph is being edited. If the graph is just a path and it doesn’t exist then a default graph will be created at that location. If the identifier is a dictionary then interpret it as a kwargs list of overrides for the CreateGraphAsNode command; at a minimum the “graph_path” argument must be present so that the graph node location can be identified.

  • edit_commands – Dictionary of commands and parameters indicating what modifications are to be made to the specified graph. A strict set of keys is accepted. Each of the values in the dictionary can be either a single value or a list of values of the proscribed type.

Returns

  • the og.Graph being used for the operation

  • the list of og.Nodes created by the operation

  • the list of Usd.Prims created by the operation

  • the map of node/prim path name to the created og.Node/Usd.Prim objects. Can usually be ignored; it will be used internally to manage the shortform names of the paths used in multiple commands.

Return type

A 4-tuple consisting of

Raises
  • og.OmniGraphError if any of the graph creation instructions could not be fulfilled

  • The graph will be left in the partially constructed state it reached at the time of the error

async classmethod evaluate(graph_id: Optional[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph, List[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]]]] = None)

Wait for the next Graph evaluation cycle - await this function to ensure it is finished before returning.

Parameters

graph_id – Description of a graph or list of graphs to evaluate - None means all existing graphs

classmethod evaluate_sync(graph_id: Optional[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph, List[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]]]] = None)

Run the next Graph evaluation cycle immediately.

Runs the async evaluate as a task and waits for its completion so that callers don’t have to worry about setting up their own loop. Works inside an existing event loop or creates its own if needed.

Parameters

graph_id – Description of a graph or list of graphs to evaluate - None means all existing graphs

omni.graph.core.CreateAttrCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.CreateGraphAsNodeCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.CreateNodeCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.CreateSubgraphCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.CreateVariableCommand(*args, **kwargs)

Redirect function calls to the real class

class omni.graph.core.DataStealing

Manage the lifetime of a scene suitable for data stealing performance measurements

async run_array_timing_tests(performance: omni.graph.core._impl.performance.OmniGraphPerformance, points: List[int], chain_lengths: List[int], chains: List[int], percents_modified: List[float], file_name: Optional[str] = None)Union[str, List[Tuple[int, int, int, float, float, float]]]

Generate a variety of timing results with the various configurations

Create timing data for scenes that use a combinatorial combination of the list values passed in. The timing information will either be dumped to a .csv file if the file_name is specified or returned if not.

This method is a coroutine so that it can await file operations. Easiest way to call it is to put it into a task and set a callback for when the task is done. Nothing else should be happening while this test is running.

Parameters
  • performance – Manager of the performance data gathering

  • points – Number of points in the chain of deformer-like nodes

  • chain_lengths – Number of nodes in each chain of deformer-like nodes

  • chains – Number of independent chains

  • percents_modified – Percentage of the points to be affected by each step of the chain

  • file_name – If a string, the path to the .csv file where the results go

Returns

If file_name is not None then return the file_name back. Otherwise return the list of results generated in CSV-compatible form. Row data consists of information for a single run: Point Count, Chain Length, Chain Count, Total Evaluation Time, Avg. Generator Time, Avg. Perturb Time, Memory Used

async set_up_scene(array_size: int, bundle_size: Optional[int] = None, chain_length: int = 1, chain_count: int = 1, percent_modified: float = 100.0)

Define a new scene that modifies point array values of attributes within a bundle

Parameters
  • array_size – Number of elements in the array data

  • bundle_size – Number of attributes in the generated bundle (None means use nodes without bundles)

  • chain_length – Number of nodes in the chain

  • chain_count – Number of chains in the scene

  • percent_modified – Percentage of the points to be affected by each step of the chain

The chains are set up with generate-points and perturb-points nodes, with multiple instances of the latter set up serially so that data is shared across the entire chain of nodes. Multiple chains are used to determine how the performance scales with multiple sets of copies being made. The array_size determines how many points are in a points attribute, as generated by the random point generator node at the start of the chain. If the bundle size is not None then the version of the nodes that use bundles for point attributes is used instead of the direct array attributes.

For example, for chain_length=5, chain_count=2 the stage would look like this:

/Chain1

/Generator /Perturb1 /Perturb2 /Perturb3 /Perturb4 /Perturb5

/Chain2

/Generator /Perturb1 /Perturb2 /Perturb3 /Perturb4 /Perturb5

In OmniGraph the connections would be from Generator.outputs:bundle -> Perturb.inputs:bundle at the start of the chain and Perturb.outputs:bundle -> Perturb.inputs:bundle in the middle of the chain:

Generator -> Perturb1 -> Perturb2 -> Perturb3 -> Perturb4 -> Perturb5

Evaluation should be set to the push model to ensure all nodes are evaluated every frame.

property stealing

Returns the data stealing prototype object to use - if no graph is available then return None

property stealing_enabled

Returns True if the data stealing prototype has been enabled

property use_python_nodes

Is the generator going to use Python type nodes?

class omni.graph.core.DataStealingPrototype
bundle_lookup_location(self: omni.graph.core._omni_graph_core.DataStealingPrototype, src: omni.graph.core._omni_graph_core.Bundle)omni.graph.core._omni_graph_core.Bundle

Finds the lookup location for a given bundle.

Parameters

[og.Bundle] (arg0) – Bundle whose location is to be looked up

Returns

The actual location from which the bundle gets its data.

Return type

[og.Bundle]

enabled(self: omni.graph.core._omni_graph_core.DataStealingPrototype)bool

Returns whether the data stealing prototype has been activated or not.

Returns

Is the data stealing prototype active on its context?

Return type

[bool]

lookup_location(self: omni.graph.core._omni_graph_core.DataStealingPrototype, src: omni.graph.core._omni_graph_core.AttributeData)omni.graph.core._omni_graph_core.AttributeData

Finds the lookup location for a given attribute data.

Parameters

[og.AttributeData] (arg0) – AttributeData whose location is to be looked up

Returns

The actual location from which the AttributeData gets its data.

Return type

[og.AttributeData]

set_bundle_lookup_location(self: omni.graph.core._omni_graph_core.DataStealingPrototype, to_link: omni.graph.core._omni_graph_core.Bundle, link_destination: omni.graph.core._omni_graph_core.Bundle)bool

Sets the lookup location for a given attribute data.

Parameters
  • [og.Bundle] (arg1) – Bundle whose location is to be redirected

  • [og.Bundle] – The actual location from which the bundle should now get its data.

set_enabled(self: omni.graph.core._omni_graph_core.DataStealingPrototype, enabled: bool)None

Sets whether the data stealing prototype is active.

Parameters

[bool] (arg0) – Is the data stealing prototype active on its context?

set_lookup_location(self: omni.graph.core._omni_graph_core.DataStealingPrototype, to_link: omni.graph.core._omni_graph_core.AttributeData, link_destination: omni.graph.core._omni_graph_core.AttributeData)bool

Sets the lookup location for a given attribute data.

Parameters
  • [og.AttributeData] (arg1) – AttributeData whose location is to be redirected

  • [og.AttributeData] – The actual location from which the AttributeData should now get its data.

class omni.graph.core.DataView(*args, **kwargs)

Helper class for getting and setting attribute data values. The setting operation is undoable.

Interfaces:

get get_array_size set

All of the interface functions can either be called from an instantiation of this object or from a class method of the same name with an added attribute parameter that tells where to get and set values.

DUAL_METHODS = {'get': '_cls_get', 'get_array_size': '_cls_get_array_size', 'set': '_cls_set'}

Names of methods shared as both class and object methods, mapped to the classmethod implementation

get(on_gpu: bool = False, reserved_element_count: Optional[int] = None, return_type: Optional[omni.graph.core._impl.attribute_values.WrappedArrayType] = None)Any

Returns the current value on the owned attribute.

Parameters
  • on_gpu – Is the value stored on the GPU?

  • reserved_element_count – For array attributes, if not None then the array will pre-reserve this many elements

  • return_type – For array attributes this specifies how the return data is to be wrapped

Raises

OmniGraphError – If the current attribute is not valid or its value could not be retrieved

get_array_size()int

Returns the current number of array elements on the owned attribute.

Raises

OmniGraphError – If the current attribute is not valid or is not an array type

set(value: Union[Any, omni.graph.core._impl.utils.TypedValue], on_gpu: bool = False, update_usd: bool = False)

Sets the current value on the owned attribute. This is an undoable action.

Parameters
  • value – The new value for the attribute

  • on_gpu – Is the value stored on the GPU?

  • update_usd – Should the value immediately propagate to USD?

Raises

OmniGraphError – If the current attribute is not valid or could not be set to the given value

class omni.graph.core.DataWrapper(memory: int, dtype: omni.graph.core._impl.dtypes.Dtype, shape: Union[None, int, Tuple[int, int], Tuple[Tuple[int, int]], Tuple[Tuple[int, int], int], Tuple[int, int, int], Tuple[int, int, Tuple[int, int]]], device: omni.graph.core._impl.data_typing.Device)

Wrapper around typed memory data.

This class provides no functionality for manipulating the data, only for inspecting it and extracting it for other code to manipulate it. e.g. you could extract CPU data as a numpy array and modify values, though you cannot change its size, or you could extract the pointer to the GPU data for passing in to a GPU-aware package like TensorFlow. External functions will perform these conversions.

memory

Address of the data in the memory space

dtype

Data type information for the individual data elements

shape

Array shape of the memory

device

Object containing the location of the memory

class omni.graph.core.Database(node: omni.graph.core._omni_graph_core.Node, context_helper: Optional[omni.graph.core._impl.v1_5_0.context_helper.ContextHelper] = None)

Base class for the generated database class for .ogn nodes (Python and C++ implementations)

Defines some common functionality that is the same for nodes of all types, to help cut down on the amount of redundant generated code.

Like the C++ equivalent, you can access the ABI data types normally passed to the compute as:

db.abi_node db.abi_context

Derived classes will have these class member variables instantiated, which are manipulated here in order to keep the amount of generated code to a minimum:

  • INTERFACE: Attribute interface definition information - things that don’t change between nodes of the same type

  • PER_NODE_DATA: Dictionary for data that is different on every node of the same type.

LOGGED_HOT_RELOAD_PROBLEM = {}
ROLE_BUNDLE = 'bundle'
ROLE_COLOR = 'color'
ROLE_EXECUTION = 'execution'
ROLE_FRAME = 'frame'
ROLE_MATRIX = 'matrix'
ROLE_NORMAL = 'normal'
ROLE_OBJECT_ID = 'objectId'
ROLE_PATH = 'path'
ROLE_POINT = 'point'
ROLE_QUATERNION = 'quaternion'
ROLE_TEXCOORD = 'texcoord'
ROLE_TIMECODE = 'timecode'
ROLE_TRANSFORM = 'transform'
ROLE_VECTOR = 'vector'
property abi_context

Returns the graph context to which this database belongs

property abi_node

Returns the node to which this database belongs

classmethod dynamic_attribute_data(node: omni.graph.core._omni_graph_core.Node, port_type: omni.graph.core._omni_graph_core.AttributePortType)omni.graph.core._impl.database.DynamicAttributeInterface

Returns the dynamic attribute data class stored on each node for a given port type

get_metadata(metadata_key: str, attribute: Optional[omni.graph.core._omni_graph_core.Attribute] = None)Optional[str]

Get metadata related to this node.

To get the metadata on the node type:

ui_name = db.get_metadata(MetadataKeys.UI_NAME)

To get the metadata from a specific attribute:

input_x_ui_name = db.get_metadata(MetadataKeys.UI_NAME, db.attribute.inputs.x)

Parameters
  • metadata_key – Name of the metadata value to return

  • attribute – Attribute on which the metadata lives. If None then look at the node type’s metadata

Returns

Metadata value string, or None if the named metadata key did not exist

get_variable(name: str)

Get the value of a variable with a given name. Returns None if the variable does not exist on the graph.

log_error(message: str, add_context: bool = True)

Log an error message from a compute method, for when the compute data is inconsistent or unexpected

log_info(message: str)

Log an information message from a compute method, when status information is required about the compute. Usually the compute will be successful, the information is for debugging or analysis.

log_warn(message: str)

Log a warning message from a compute method, when the compute is consistent but produced no results. This method is identical to log_warning; both exist because there are different conventions in other code about which name to use, so to avoid wasted developer time fixing unimportant incorrect guesses both are implemented.

log_warning(message: str)

Log a warning message from a compute method, when the compute is consistent but produced no results. This method is identical to log_warn; both exist because there are different conventions in other code about which name to use, so to avoid wasted developer time fixing unimportant incorrect guesses both are implemented.

move(dst: omni.graph.core._omni_graph_core.Attribute, src: omni.graph.core._omni_graph_core.Attribute)

Point the data for the src attribute at the data for the destination attribute. This is similar to an assigment, like “db.outputs.x = db.inputs.x” except that instead of making a copy, the data reference is simply moved

classmethod per_node_data(node: omni.graph.core._omni_graph_core.Node)Dict[str, Any]

Returns the per-node data for the given node

Parameters

node – OmniGraph node for which the data is to be retrieved

Raises

og.OmniGraphError – If the per-node data is missing, most likely because the node is not initialized

classmethod per_node_errors(node: omni.graph.core._omni_graph_core.Node)

Returns the compute errors on the node, or [] if it does not exist

classmethod per_node_internal_state(node: omni.graph.core._omni_graph_core.Node)

Returns the internal state information on the node, or None if it does not exist

set_variable(name: str, value)

Set the value of a variable. og.OmniGraphError will be raised if the variable does not exist on the graph, or if there is type mismatch

omni.graph.core.DeleteNodeCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.DeleteNodeData_t

alias of str

class omni.graph.core.DeprecateMessage

Manager for deprecation messages, to make it efficient to prevent multiple logging of the same deprecation messages.

The default settings for output is usually enough to help you find where deprecated code is referenced. If more information is desired these per-class variables can be set to reduce the filtering being done. The message should contains an action item for the user to upgrade from the deprecated functionality:

DeprecateMessage.deprecated("Install the latest version instead")

# Although it's not usually necessary the class can be tuned using these class variable

SILENCE_LOG = False  # When set the output does not go to the console log; useful to disable for testing
SHOW_STACK = True  # Report stack trace in the deprecation message - can be turned off if it is too verbose
MAX_STACK_LEVELS = 3  # Maximum number of stack levels to report, after filtering
RE_IGNORE = re.compile("deprecate.py|bindings-python|importlib")  # Ignore stack levels matching these patterns
MAX_STACK_LEVELS = 3
MESSAGES_LOGGED = {"omni.graph.tools._impl.v1_2_0.autograph is deprecated. Use 'import omni.graph.core.autograph as oga; oga.OBJECT' instead"}
class NoLogging

Context manager class to let you import a bunch of known deprecated functions without logging warnings. Typical use would be in providing backward compatibility in a module where submodules have moved.

with DeprecateMessage.NoLogging():

import .v1_0.my_old_function as my_old_function

RE_IGNORE = re.compile('deprecate.py|bindings-python|importlib')
SHOW_STACK = True
SILENCE_LOG = False
classmethod deprecated(message: str)

Log the deprecation message if it has not yet been logged, otherwise do nothing

Parameters

message – Message to display; only displays once even if this is called many times

Adds stack trace information if the class member SHOW_STACK is True. Skips the Carbonite logging if the class member SILENCE_LOG is True (mostly useful for testing when a warning is the expected result).

class omni.graph.core.DeprecatedClass(deprecation_message: str)

Decorator to deprecate a class. Takes one argument that is a string to describe the action the user is to take to avoid the deprecated class. A deprecation message will be shown once, the first time the deprecated class is instantiated.

@DeprecatedClass("After version 1.5.0 use og.NewerClass instead")
class OlderClass:
    pass
message(deprecated_cls, deprecated_member: Optional[str] = None)

Emit a deprecation message with useful information attached

omni.graph.core.DeprecatedImport(deprecation_message: str)

Decorator to deprecate a specific file or module import. Usually the functionality has been deprecated and moved to a different file.

Parameters

deprecation_message – String with the action the user is to perform to avoid the deprecated import

Usage:

'''This is the top line of the imported file'''
import omni.graph.tools as og
og.DeprecatedImport("Import 'omni.graph.tools as og' and use og.new_function() instead")

# The rest of the file can be left as-is for best backward compatibility, or import non-deprecated versions
# of objects from their new location to avoid duplication.
class omni.graph.core.Device(device_name: str)

Device type for memory location of the data types

property cpu

Is the device a CPU?

property cuda

Is the device a GPU programmed with CUDA?

omni.graph.core.DisableGraphCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.DisableGraphUSDHandlerCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.DisableNodeCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.DisconnectAllAttrsCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.DisconnectAttrsCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.DisconnectPrimCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.Double(x)
omni.graph.core.Double2(x)
omni.graph.core.Double3(x)
omni.graph.core.Double4(x)
class omni.graph.core.Dtype(tuple_count: Optional[int] = None, size: Optional[int] = None, base_type: Optional[int] = None, ctype: Optional[object] = None)

Common base type for dtypes, defining the members each needs to populate tuple_count (int): The number of atomic elements in this type size (int): The total size in bytes of this type base_type (og.BaseDataType): The base data type of this type ctype (object): The ctypes representation used by this data type in FlatCache

base_type: Optional[int] = None
ctype: Optional[object] = None
classmethod is_matrix_type()bool

Returns true if the dtype is a matrix. Uses derived class knowledge to keep it simple

size: Optional[int] = None
tuple_count: Optional[int] = None
class omni.graph.core.DualMethodName

This class, when used as a metaclass, facilitates using the same method name for both class and object methods, calling different implementations internally.

# To use it you first declare your class to have this one as its metaclass
class MyClass(metaclass=DualMethodName):

    # Then you add a redirection table as a class variable, where the key is the shared method name and
    # the value is the name of the @classmethod that implements it.
    DUAL_METHODS={"edit": "_cls_edit"}

    # This indicates that the actual method calls will look like this:
    #    MyClass.edit() -> _cls_edit()
    #    MyClass().edit() -> edit()

    # For consistency you can choose to implement a common method with the implementation logic, or you can
    # handle it any other way that's appropriate
    @classmethod
    def __implement_edit(cls, some_object):
        pass

    # Implementations that illustrate the difference between the two methods being called
    def edit(self):
        return self.__implement_edit(self.some_object)
    @classmethod
    def _cls_edit(self):
        return cls.__implement_edit(SomeObject())

# The metaclass understands inheritance so it can be put at the lowest level of a class hierarchy and
# all of the derived classes will have the chance to enhance the redirection list simply by defining the
# same class variable. Any duplicate key names will be redirected to the one appropriate to the type of object.
class MyOtherClass(MyClass):
    DUAL_METHODS={"run": "_cls_run", "stop": "_cls_stop"}
class omni.graph.core.DynamicAttributeAccess(context_id: Union[omni.graph.core._omni_graph_core.GraphContext, omni.graph.core._impl.v1_5_0.context_helper.ContextHelper], node: omni.graph.core._omni_graph_core.Node, attributes, dynamic_attributes: omni.graph.core._impl.database.DynamicAttributeInterface)

Base class for the generated classes that contain the access properties for all attributes. Each of the port containers, db.inputs/db.outputs/db.state, houses the attribute data access properties. These containers are constructed when the database is created, with hardcoded properties for all statically defined attributes. This class intercepts getattr/setattr/delattr calls to check to see if the property being requested is a dynamic attribute, and if so then it uses the properties stored in the per-node data as the access points.

So the lookup sequence goes:
db -> og.Database
.inputs -> ValuesForInput(DynamicAttributeAccess)
.myAttribute -> DynamicAttributeAccess.__getattr__

-> ValuesForInput.__getattr__ (if the above fails)

It makes the bold assumption that the attributes are all set up nicely; no duplicate names, invalid types, missing configuration, etc.

Attributes use leading underscores to minimize name collisions with the dynamically added attributes. (Double underscores would have been preferable but would have made access from the derived classes problematic.)

Members:

_context: Graph context used for evaluating this node _node: The OmniGraph node to which this data belongs _attributes: The set of attributes on this object’s port _dynamic_attributes: Container holding the per-node specification of dynamic attributes, not visible to derived classes

get_dynamic_attributes()omni.graph.core._impl.database.DynamicAttributeInterface

Returns the dynamic attributes managed by this class, avoiding the __getattr__ override

class omni.graph.core.DynamicAttributeInterface(port_type: omni.graph.core._omni_graph_core.AttributePortType)

Class providing a container for dynamic attribute access interfaces. One of these objects is created per-node, per-port, to contain getter and setter properties on dynamic attributes for their node and port type. These classes persist in the per-node data and their property members are updated based on the addition and removal of dynamic attributes from their node. The base class implementation for the attribute accessors, DynamicAttributeAccess, uses this to determine whether an attribute access request was made on a static or dynamic attribute.

The per-node data on the database will contain one of these objects per port-type. When the database is created it will be attached to the primary attribute access classes via the base class below, DynamicAttributeAccess.

Members:
_port_type: Type of port managed by this class (only one allowed per instance). Single underscore only so that

the base class of the attribute information can access it.

_interfaces: Dictionary of str:og.Attribute values which maps the names of a dynamic attribute to the actual

attribute on the node.

add_attribute(new_attribute: omni.graph.core._omni_graph_core.Attribute)

Add in the interface for a newly created attribute.

This creates a new attribute on this object named for the new attribute. The value of that attribute is a pair of functions that will get and set the value for that attribute.

Parameters

new_attribute – Attribute that was just added

Raises

og.OmniGraphError – If the attribute has a mismatched port type

get(property_name: str, context_helper: Optional[omni.graph.core._impl.v1_5_0.context_helper.ContextHelper] = None)Any

Returns the value of the named attribute

Parameters
  • property_name – Name of the property within the namespace of this object’s port type

  • context_helper – Deprecated

Raises

og.OmniGraphError – If the attribute is unknown

has_attribute(property_name: str)bool

Returns True if the given property name is a known dynamic attribute on this object

remove_attribute(old_attribute: omni.graph.core._omni_graph_core.Attribute)

Remove the interface for a newly deleted attribute

Parameters

old_attribute – Attribute that is about to be removed

Raises

og.OmniGraphError – If the attribute has a mismatched port type, or the property didn’t exist

set(property_name: str, context_helper: Optional[omni.graph.core._impl.v1_5_0.context_helper.ContextHelper] = None, locked: bool = False, new_value: Optional[Any] = None)

Sets the value of the named attribute

Parameters
  • property_name – Name of the property within the namespace of this object’s port type

  • context_helper – Deprecated

  • locked – True if setting read-only values is currently locked (i.e. inside a compute)

  • new_value – Value to be set on the attribute with the given name

Raises
  • og.OmniGraphError – If the attribute is unknown

  • og.ReadOnlyError – If writing is locked and the attribute is read-only

omni.graph.core.EnableGraphCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.EnableGraphUSDHandlerCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.EnableNodeCommand(*args, **kwargs)

Redirect function calls to the real class

class omni.graph.core.ExecutionAttributeState

Members:

DISABLED

ENABLED

ENABLED_AND_PUSH

LATENT_PUSH

LATENT_FINISH

DISABLED = ExecutionAttributeState.DISABLED
ENABLED = ExecutionAttributeState.ENABLED
ENABLED_AND_PUSH = ExecutionAttributeState.ENABLED_AND_PUSH
LATENT_FINISH = ExecutionAttributeState.LATENT_FINISH
LATENT_PUSH = ExecutionAttributeState.LATENT_PUSH
property name

handle) -> str

Type

(self

class omni.graph.core.ExtendedAttributeType

Members:

EXTENDED_ATTR_TYPE_REGULAR

EXTENDED_ATTR_TYPE_UNION

EXTENDED_ATTR_TYPE_ANY

EXTENDED_ATTR_TYPE_ANY = ExtendedAttributeType.EXTENDED_ATTR_TYPE_ANY
EXTENDED_ATTR_TYPE_REGULAR = ExtendedAttributeType.EXTENDED_ATTR_TYPE_REGULAR
EXTENDED_ATTR_TYPE_UNION = ExtendedAttributeType.EXTENDED_ATTR_TYPE_UNION
property name

handle) -> str

Type

(self

class omni.graph.core.ExtensionInformation

Class that manages information about the relationships between nodes and node types, and extensions

Public Interface:

get_node_types_by_extension() get_nodes_by_extension()

KEY_UNKNOWN_EXTENSION = 'Unknown'
get_node_types_by_extension()Dict[str, List[str]]

Returns a tuple of two dictionaries. The first is the dictionary of enabled extensions to the list of nodes in the scene whose node types they implement, the second is the same thing for disabled extensions.

get_nodes_by_extension()Tuple[Dict[str, List[str]], Dict[str, List[str]]]

Returns a tuple of three dictionaries. - Map of enabled extensions to the list of nodes in the scene whose node types they implement - Map of disabled extensions to the list of nodes in the scene whose node types they implement

class omni.graph.core.FileFormatVersion
property majorVersion
property minorVersion
omni.graph.core.Float(x)
omni.graph.core.Float2(x)
omni.graph.core.Float3(x)
omni.graph.core.Float4(x)
class omni.graph.core.Graph
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, arg0: str, arg1: str, arg2: str, arg3: bool, arg4: bool, arg5: omni.graph.core._omni_graph_core.GraphBackingType, arg6: omni.graph.core._omni_graph_core.GraphPipelineStage)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)

Returns

Node wrapping the graph that was created

Return type

(omni.graph.core.Node)

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

(omni.graph.core.Graph)

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
Returns

A reference to the newly created variable, or None if the variable could not be created.

Return type

(omni.graph.core.IVariable)

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, arg0: str, arg1: bool)bool

Given the path to the node, destroys the node at that path.

Parameters
  • arg0 (str) – The path to the node

  • getDefault (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_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_event_stream(self: omni.graph.core._omni_graph_core.Graph)carb.events._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 (flatcache 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

(omni.graph.core.Node)

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

(omni.graph.core.Graph)

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_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.

class omni.graph.core.GraphBackingType

Members:

GRAPH_BACKING_TYPE_FLATCACHE_SHARED

GRAPH_BACKING_TYPE_FLATCACHE_WITH_HISTORY

GRAPH_BACKING_TYPE_FLATCACHE_WITHOUT_HISTORY

GRAPH_BACKING_TYPE_NONE

GRAPH_BACKING_TYPE_UNKNOWN

GRAPH_BACKING_TYPE_FLATCACHE_SHARED = GraphBackingType.GRAPH_BACKING_TYPE_FLATCACHE_SHARED
GRAPH_BACKING_TYPE_FLATCACHE_WITHOUT_HISTORY = GraphBackingType.GRAPH_BACKING_TYPE_FLATCACHE_WITHOUT_HISTORY
GRAPH_BACKING_TYPE_FLATCACHE_WITH_HISTORY = GraphBackingType.GRAPH_BACKING_TYPE_FLATCACHE_WITH_HISTORY
GRAPH_BACKING_TYPE_NONE = GraphBackingType.GRAPH_BACKING_TYPE_NONE
GRAPH_BACKING_TYPE_UNKNOWN = GraphBackingType.GRAPH_BACKING_TYPE_UNKNOWN
property name

handle) -> str

Type

(self

class omni.graph.core.GraphContext
get_attribute_as_bool(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)bool

Return the value of a boolean attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(bool)

get_attribute_as_boolarray(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)numpy.ndarray[bool]

Return the value of a bool array attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(numpy.array[int])

get_attribute_as_double(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)float

Return the value of a double attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(float)

get_attribute_as_doublearray(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)numpy.ndarray[float64]

Return the value of a double array attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

Returns

Value of the attribute

Return type

(numpy.array[float])

get_attribute_as_doublearray_tensor(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, is_on_gpu: bool = False, write: bool = False, write_element_count: int = 0)PyTorchTensor<double>

Return the value of a double array attributein tensor form.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not the tensor is on the GPU

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(PyTorch[float])

get_attribute_as_float(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)float

Return the value of a float attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(float)

get_attribute_as_floatarray(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)numpy.ndarray[float32]

Return the value of a float array attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(numpy.array[float])

get_attribute_as_floatarray_tensor(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, is_on_gpu: bool = False, write: bool = False, write_element_count: int = 0)PyTorchTensor<float>

Return the value of a float array attribute in tensor form.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not the tensor is on the GPU

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(PyTorch[float])

get_attribute_as_half(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)float

Return the value of a half-precision float attribute

Parameters
  • attribute (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute as a float

Return type

(float)

get_attribute_as_halfarray(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)numpy.ndarray[float32]

Set the value of an attribute that is an array of half-precision floats.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(numpy.array[float])

get_attribute_as_int(self: omni.graph.core._omni_graph_core.GraphContext, arg0: omni.graph.core._omni_graph_core.Attribute, arg1: bool, arg2: bool, arg3: int)int

Return the value of an integer attribute

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value.

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(int)

get_attribute_as_int64(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)int

Return the value of a 64-bit integer attribute

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value.

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(int)

get_attribute_as_int64array(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)numpy.ndarray[int64]

Return the value of a 64-bit integer array attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

Returns

Value of the attribute

Return type

(numpy.array[int])

get_attribute_as_intarray(self: omni.graph.core._omni_graph_core.GraphContext, arg0: omni.graph.core._omni_graph_core.Attribute, arg1: bool, arg2: bool, arg3: int)numpy.ndarray[int32]

Return the value of an integer array attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(numpy.array[int])

get_attribute_as_intarray_tensor(self: omni.graph.core._omni_graph_core.GraphContext, arg0: omni.graph.core._omni_graph_core.Attribute, arg1: bool, arg2: bool, arg3: int)PyTorchTensor<int>

Return the value of an integer array attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(numpy.array[int])

get_attribute_as_nested_doublearray(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)numpy.ndarray[float64]

Return the value of a double array having a component count greater than 1 (e.g. double[3]).

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(numpy.array[double][double])

get_attribute_as_nested_doublearray_tensor(self: omni.graph.core._omni_graph_core.GraphContext, arg0: omni.graph.core._omni_graph_core.Attribute, arg1: bool, arg2: bool, arg3: int)PyTorchTensor<double>

Return the value of a double array having a component count greater than 1 (e.g. double[3]) as a tensor.

Parameters

attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

Returns

Value of the attribute

Return type

(PyTorch[double][double])

get_attribute_as_nested_floatarray(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)numpy.ndarray[float32]

Return the value of a float array having a component count greater than 1 (e.g. float[3]).

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(numpy.array[float][float])

get_attribute_as_nested_floatarray_tensor(self: omni.graph.core._omni_graph_core.GraphContext, arg0: omni.graph.core._omni_graph_core.Attribute, arg1: bool, arg2: bool, arg3: int)PyTorchTensor<float>

Return the value of a float array having a component count greater than 1 (e.g. float[3]) as a tensor.

Parameters

attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

Returns

Value of the attribute

Return type

(PyTorch[float][float])

get_attribute_as_nested_halfarray(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)numpy.ndarray[float32]

Return the value of a half-precision float array having a component count greater than 1 (e.g. half[3]).

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(numpy.array[float][float])

get_attribute_as_nested_intarray(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)numpy.ndarray[int32]

Return the value of a int array having a component count greater than 1 (e.g. int[3]).

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(numpy.array[int][int])

get_attribute_as_nested_intarray_tensor(self: omni.graph.core._omni_graph_core.GraphContext, arg0: omni.graph.core._omni_graph_core.Attribute, arg1: bool, arg2: bool, arg3: int)PyTorchTensor<int>

Return the value of a int array having a component count greater than 1 (e.g. int[3]) as a tensor.

Parameters

attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

Returns

Value of the attribute

Return type

(PyTorch[float][float])

get_attribute_as_string(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)str

Return the value of a string attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(str)

get_attribute_as_stringlist(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)list

Return the value of a string list attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

list(str)

get_attribute_as_uchar(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)int

Return the value of an unsigned char attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(int)

get_attribute_as_uchararray(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)numpy.ndarray[uint8]

Return the value of an unsigned char array attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(numpy.array[int])

get_attribute_as_uint(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)int

Return the value of an unsigned integer attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(int)

get_attribute_as_uint64(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)int

Return the value of an unsigned 64-bit integer attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(int)

get_attribute_as_uint64array(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)numpy.ndarray[uint64]

Return the value of an unsigned 64-bit integer array attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(numpy.array[int])

get_attribute_as_uintarray(self: omni.graph.core._omni_graph_core.GraphContext, attribute: omni.graph.core._omni_graph_core.Attribute, getDefault: bool = False, write: bool = False, writeElemCount: int = 0)numpy.ndarray[uint32]

Return the value of an unsigned integer array attribute.

Parameters
  • attribute0 (omni.graph.core.Attribute) – The attribute whose value is to be retrieved

  • getDefault (bool) – Whether or not to get the default value

  • write (bool) – Whether or not to get the value for writing

  • writeElemCount – (int) Number of elements to be written, if getting the value for writing

Returns

Value of the attribute

Return type

(numpy.array[int])

get_bundle(self: omni.graph.core._omni_graph_core.GraphContext, arg0: str)omni::graph::core::Py_Bundle

Get the bundle object.

Parameters

arg0 (str) – the prim path to the bundle

get_elapsed_time(self: omni.graph.core._omni_graph_core.GraphContext)float

Returns the time between last evaluation of the graph and “now”

Returns

the elapsed time

get_elem_count(*args, **kwargs)

Overloaded function.

  1. get_elem_count(self: omni.graph.core._omni_graph_core.GraphContext, arg0: omni::graph::core::Py_AttributeData) -> int

    Get the number of elements in an array attribute data.

    Args:

    arg0 (omni.graph.core.AttributeData): the attribute data identifying the location

    Returns:

    (int): The number of elements in the array attribute data

  2. get_elem_count(self: omni.graph.core._omni_graph_core.GraphContext, arg0: omni.graph.core._omni_graph_core.Attribute) -> int

    Get the number of elements in an array attribute.

    Args:

    attribute0 (omni.graph.core.Attribute): the attribute identifying the location

    Returns:

    (int): The number of elements in the array attribute

get_frame(self: omni.graph.core._omni_graph_core.GraphContext)float

Returns the global playback time in frames

Returns

the global playback time in frames

get_graph(self: omni.graph.core._omni_graph_core.GraphContext)omni.graph.core._omni_graph_core.Graph

Returns the graph associated with this graph context.

get_input_bundle(self: omni.graph.core._omni_graph_core.GraphContext, arg0: omni.graph.core._omni_graph_core.Node, arg1: str)omni::graph::core::Py_Bundle

Get a bundle object that is an input attribute.

Parameters
  • arg0 (omni.graph.core.Node) – the node on which the bundle can be found

  • arg1 (str) – the name of the input attribute

get_is_playing(self: omni.graph.core._omni_graph_core.GraphContext)bool

Returns the state of global playback

Returns

True if playback has started, False is playback is stopped

get_output_bundle(self: omni.graph.core._omni_graph_core.GraphContext, arg0: omni.graph.core._omni_graph_core.Node, arg1: str)omni::graph::core::Py_Bundle

Get a bundle object that is an output attribute.

Parameters
  • arg0 (omni.graph.core.Node) – the node on which the bundle can be found

  • arg1 (str) – the name of the output attribute

get_time(self: omni.graph.core._omni_graph_core.GraphContext)float

Returns the global playback time

Returns

the global playback time in seconds

get_time_since_start(self: omni.graph.core._omni_graph_core.GraphContext)float

Returns the elapsed time since the app started

Returns

the number of seconds since the app started in seconds

inspect(self: omni.graph.core._omni_graph_core.GraphContext, arg0: omni::core::Api<omni::inspect::IInspector_abi>)bool

Runs the inspector on the graph context

Parameters

arg0 (omni.inspect.Inspector) – The inspector to run

Returns

True if the inspector was successfully run on the context, False if it is not supported

Return type

(bool)

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

Returns whether this compute graph context object is valid or not.

set_bool_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: bool, arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a boolean attribute.

Parameters
set_boolarray_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: List[bool], arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a bool array attribute.

Parameters
  • arg0 (List, numpy.array) – The list of values to set

  • arg1 (omni.graph.core.Attribute) – the attribute identifying the location

set_double_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: float, arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a double attribute.

Parameters
set_double_matrix_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: List[float], arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a double matrix attribute The length of the list must match the expected type. For matrix2d, it’s 4, for matrix3d it’s 9, and for matrix4d, it’s 16

Parameters
  • arg0 (List, numpy.array) – The list of values in row major format representing a matrix to set

  • arg1 (omni.graph.core.Attribute) – the attribute identifying the location

set_doublearray_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: List[float], arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a double array attribute.

Args :

arg0: The list of values to set arg1(omni.graph.core.Attribute): the attribute identifying the location

set_float_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: float, arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a float attribute.

Parameters
set_floatarray_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: List[float], arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a float array attribute.

Parameters
  • arg0 (List, numpy.array) – The list of values to set

  • arg1 (omni.graph.core.Attribute) – the attribute identifying the location

set_half_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: float, arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a half-precision float attribute.

Parameters
set_halfarray_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: List[float], arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a half-precision float array attribute.

Parameters
  • arg0 (List, numpy.array) – The list of values to set

  • arg1 (omni.graph.core.Attribute) – the attribute identifying the location

set_int64_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: int, arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a 64-bit integer attribute.

Parameters
set_int64array_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: List[int], arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a 64-bit integer array attribute.

Parameters
  • arg0 (List, numpy.array) – The list of values to set

  • arg1 (omni.graph.core.Attribute) – the attribute identifying the location

set_int_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: int, arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of an integer attribute.

Parameters
set_intarray_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: List[int], arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of an integer array attribute.

Parameters
  • arg0 (List, numpy.array) – The list of values to set

  • arg1 (omni.graph.core.Attribute) – the attribute identifying the location

set_nested_doublearray_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: List[List[float]], arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a double array attribute with component count > 1 (e.g. double[3]).

Parameters
  • arg0 (List, numpy.array) – The list of nested values to set (array of array of 3 elements, for example)

  • arg1 (omni.graph.core.Attribute) – the attribute identifying the location

set_nested_floatarray_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: List[List[float]], arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a float array attribute with component count > 1 (e.g. float[3]).

Parameters
  • arg0 (List, numpy.array) – The list of nested values to set (array of array of 3 elements, for example)

  • arg1 (omni.graph.core.Attribute) – the attribute identifying the location

set_nested_halfarray_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: List[List[float]], arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a half-precision float array attribute with component count > 1 (e.g. half[3]).

Parameters
  • arg0 (List, numpy.array) – The list of nested values to set (array of array of 3 elements, for example)

  • arg1 (omni.graph.core.Attribute) – the attribute identifying the location

set_nested_intarray_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: List[List[int]], arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of an integer array attribute.

Parameters
  • arg0 (List, numpy.array) – The list of values to set

  • arg1 (omni.graph.core.Attribute) – the attribute identifying the location

set_string_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: str, arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a string attribute.

Parameters
set_stringarray_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: List[str], arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a string array attribute.

Parameters
set_uchar_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: int, arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of an unsigned char attribute.

Parameters
set_uchararray_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: List[int], arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of an unsigned char array attribute.

Parameters
  • arg0 (List, numpy.array) – The list of values to set

  • arg1 (omni.graph.core.Attribute) – the attribute identifying the location

set_uint64_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: int, arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of an unsigned 64-bit integer attribute.

Parameters
set_uint64array_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: List[int], arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of a 64-bit unsigned integer array attribute.

Parameters
  • arg0 (List, numpy.array) – The list of values to set

  • arg1 (omni.graph.core.Attribute) – the attribute identifying the location

set_uint_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: int, arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of an unsigned integer attribute.

Parameters
set_uintarray_attribute(self: omni.graph.core._omni_graph_core.GraphContext, arg0: List[int], arg1: omni.graph.core._omni_graph_core.Attribute)None

Set the value of an unsigned integer array attribute.

Parameters
  • arg0 (List, numpy.array) – The list of values to set

  • arg1 (omni.graph.core.Attribute) – the attribute identifying the location

write_bucket_to_backing(self: omni.graph.core._omni_graph_core.GraphContext, arg0: int)None

Forces the given bucket to be written to the backing storage. Raises ValueError if the bucket could not be found.

Parameters

arg0 (int) – The bucket id of the bucket to be written

class omni.graph.core.GraphController

Helper class that provides a simple interface to modifying the contents of a graph

ExposePrimNode_t

Typing for information required to expose a prim in a node

alias of Tuple[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim, pxr.Usd.Typed], Union[str, pxr.Sdf.Path, Tuple[str, omni.graph.core._omni_graph_core.Graph]]]

ExposePrimNodes_t

Typing for information required to expose a list of prims in nodes

alias of Union[Tuple[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim, pxr.Usd.Typed], Union[str, pxr.Sdf.Path, Tuple[str, omni.graph.core._omni_graph_core.Graph]]], List[Tuple[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim, pxr.Usd.Typed], Union[str, pxr.Sdf.Path, Tuple[str, omni.graph.core._omni_graph_core.Graph]]]]]

class PrimExposureType(value)

Value that specifies the method of exposing USD prims to OmniGraph

AS_ATTRIBUTES = 'attributes'
AS_BUNDLE = 'bundle'
AS_WRITABLE = 'writable'
classmethod connect(src_spec: Union[omni.graph.core._omni_graph_core.Attribute, str, pxr.Sdf.Path, Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]], Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed], Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]]], dst_spec: Union[omni.graph.core._omni_graph_core.Attribute, str, pxr.Sdf.Path, Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]], Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed], Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]]])

Create a connection between two attributes

Parameters
  • src_spec – Specification of the attribute to be the source end of the connection

  • dst_spec – Specification of the attribute to be the destination end of the connection

Raises

OmniGraphError – If attributes could not be found or the connection fails

classmethod create_graph(graph_id: Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph, Dict[str, Any]])omni.graph.core._omni_graph_core.Graph

Create a graph from the description

Parameters

graph_id – Identifier that says which graph is being edited. If the graph is just a path and it doesn’t exist then a default graph will be created at that location. If the identifier is a dictionary then interpret it as a kwargs list of overrides for the CreateGraphAsNode command; at a minimum the “graph_path” argument must be present so that the graph node location can be identified. Run ‘help(og.cmds.CreateGraphAsNode)’ for information on what args are acceptable.

Returns

(og.Graph) The created graph

Raises

og.OmniGraphError if the graph creation failed for any reason

classmethod create_node(node_id: Union[str, pxr.Sdf.Path, Tuple[str, omni.graph.core._omni_graph_core.Graph]], node_type_id: Union[str, omni.graph.core._omni_graph_core.NodeType, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim, pxr.Usd.Typed], allow_exists: bool = False, version: Optional[int] = None)omni.graph.core._omni_graph_core.Node

Create an OmniGraph node of the given type and version at the given path.

Parameters
  • node_id – Absolute path, or (Relative Path, Graph) where the node will be constructed. If an absolute path was passed in it must be part of an existing graph.

  • node_type_id – Unique identifier for the type of node to create (name or og.NodeType)

  • allow_exists – If True then succeed if a node with matching path, type, and version already exists. It is still a failure if one of those properties on the existing node does not match.

  • version – Version of the node type to create. By default it creates the most recent.

Raises

og.OmniGraphError – If one or more of the nodes could not be added to the scene for some reason.

Returns

OmniGraph node or list of nodes added to the scene

classmethod create_prim(prim_path: Union[str, pxr.Sdf.Path], attribute_values: Dict[str, Tuple[Union[str, omni.graph.core._omni_graph_core.Type], Any]], prim_type: Optional[str] = None)pxr.Usd.Prim

Create a prim node containing a predefined set of attribute values and a ReadPrim OmniGraph node for it

Parameters
  • prim_path – Location of the prim

  • attribute_values – Dictionary of {NAME: (TYPE, VALUE)} for all prim attributes The TYPE recognizes OGN format, SDF format, or og.Type values The VALUE should be in a format suitable for passing to pxr::UsdAttribute.Set()

  • prim_type – The type of prim to create. If not specified defaults to “OmniGraphPrim”

Returns

Created Usd.Prim

Raises

og.OmniGraphError – If any of the attribute specifications could not be applied to the prim, or if the prim could not be created.

classmethod create_variable(graph_id: Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph], name: str, type: Union[str, omni.graph.core._omni_graph_core.Type])omni.graph.core._omni_graph_core.IVariable

Creates a variable with the given name on the graph

Parameters
  • graph_id – The graph to create a variable on

  • name – The name of the variable to create

  • type – The type of the variable to create, either a string or an OG.Type

Raises

og.OmniGraphError – If the variable can’t be created

Returns

The created variable

classmethod delete_node(node_id: Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed, List[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]]], graph_id: Optional[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]] = None, ignore_if_missing: bool = False)bool

Deletes one or more OmniGraph nodes.

Parameters
  • node_id – Specification of a node or list of nodes to be deleted

  • graph_id – Only required if the node_id does not contain enough information to uniquely identify it

  • ignore_if_missing – If True then succeed even if no node with a matching path exists

Raises

og.OmniGraphError – If the node does not exist

Returns

True if the node is gone

classmethod disconnect(src_spec: Union[omni.graph.core._omni_graph_core.Attribute, str, pxr.Sdf.Path, Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]], Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed], Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]]], dst_spec: Union[omni.graph.core._omni_graph_core.Attribute, str, pxr.Sdf.Path, Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]], Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed], Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]]])

Break a connection between two attributes

Parameters
  • src_spec – Specification of the attribute that is the source end of the connection

  • dst_spec – Specification of the attribute that is the destination end of the connection

Raises

OmniGraphError – If attributes could not be found or the disconnection fails

classmethod disconnect_all(attribute_spec: Union[omni.graph.core._omni_graph_core.Attribute, str, pxr.Sdf.Path, Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]], Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed], Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]]])

Break all connections to and from an attribute

Parameters

attribute_spec – Attribute whose connections are to be removed. (attr or (attr, node) pair)

Raises

OmniGraphError – If attribute could not be found, connection didn’t exist, or disconnection fails

classmethod expose_prim(exposure_type: PrimExposureType, prim_id: Prim_t, node_path_id: NewNode_t)og.Node

Create a new compute node attached to an ordinary USD prim or list of prims.

Parameters
  • exposure_type – Method for exposing the prim to OmniGraph

  • prim_id – Identifier of an existing prim in the USD stage

  • node_path_id – Identifier of a node path that is valid but does not currently exist

Returns

Node exposing the prim to OmniGraph

Raises

og.OmniGraphError – if the prim does not exist, or the node path already exists

static exposed_attribute_name(exposure_type: PrimExposureType)str

Returns the name of the attribute that will be used to expose the prim for a given exposure type

static node_type_to_expose(exposure_type: PrimExposureType)str

Returns the type of node that will be used to expose the prim for a given exposure type

class omni.graph.core.GraphEvent

Graph modification event.

Members:

CREATE_VARIABLE

REMOVE_VARIABLE

CREATE_VARIABLE = GraphEvent.CREATE_VARIABLE
REMOVE_VARIABLE = GraphEvent.REMOVE_VARIABLE
property name

handle) -> str

Type

(self

class omni.graph.core.GraphPipelineStage

Members:

GRAPH_PIPELINE_STAGE_SIMULATION

GRAPH_PIPELINE_STAGE_PRERENDER

GRAPH_PIPELINE_STAGE_POSTRENDER

GRAPH_PIPELINE_STAGE_ONDEMAND

GRAPH_PIPELINE_STAGE_UNKNOWN

GRAPH_PIPELINE_STAGE_ONDEMAND = GraphPipelineStage.GRAPH_PIPELINE_STAGE_ONDEMAND
GRAPH_PIPELINE_STAGE_POSTRENDER = GraphPipelineStage.GRAPH_PIPELINE_STAGE_POSTRENDER
GRAPH_PIPELINE_STAGE_PRERENDER = GraphPipelineStage.GRAPH_PIPELINE_STAGE_PRERENDER
GRAPH_PIPELINE_STAGE_SIMULATION = GraphPipelineStage.GRAPH_PIPELINE_STAGE_SIMULATION
GRAPH_PIPELINE_STAGE_UNKNOWN = GraphPipelineStage.GRAPH_PIPELINE_STAGE_UNKNOWN
property name

handle) -> str

Type

(self

class omni.graph.core.GraphRegistry
get_node_type_version(self: omni.graph.core._omni_graph_core.GraphRegistry, node_type_name: str)int

Finds the version number of the given node type.

Parameters

arg0 (str) –

Returns

Version number registered for the node type, None if it is not registered

Return type

(int)

inspect(self: omni.graph.core._omni_graph_core.GraphRegistry, arg0: omni::core::Api<omni::inspect::IInspector_abi>)bool

Runs the inspector on the graph registry

Parameters

arg0 (omni.inspect.Inspector) – The inspector to run

Returns

True if the inspector was successfully run on the graph registry, False if it is not supported

Return type

(bool)

class omni.graph.core.GraphSettings(evaluator_type: str = 'push', file_format_version: Tuple[int, int] = (0, 0), fabric_backing: str = GraphBackingType.GRAPH_BACKING_TYPE_FLATCACHE_SHARED, pipeline_stage: str = GraphPipelineStage.GRAPH_PIPELINE_STAGE_SIMULATION)

Container for the set of settings in a graph. This is a class instead of a tuple so that future additions to the settings do not break backward compatibility

evaluator_type: str = 'push'
fabric_backing: str = GraphBackingType.GRAPH_BACKING_TYPE_FLATCACHE_SHARED
file_format_version: Tuple[int, int] = (0, 0)
pipeline_stage: str = GraphPipelineStage.GRAPH_PIPELINE_STAGE_SIMULATION
omni.graph.core.Half(x)
omni.graph.core.Half2(x)
omni.graph.core.Half3(x)
omni.graph.core.Half4(x)
class omni.graph.core.IEventStream
abstract create_subscription_to_pop(callback: Callable, name: Optional[str])
abstract create_subscription_to_pop_by_type(callback: Callable, event_type: enum.Enum, name: Optional[str])
abstract create_subscription_to_push_by_type(callback: Callable, event_type: enum.Enum, name: Optional[str])
abstract create_subscription_to_self(callback: Callable, name: Optional[str])
classmethod get_event_type()
class omni.graph.core.INodeCategories
property category_count
define_category(self: omni.graph.core._omni_graph_core.INodeCategories, arg0: str, arg1: str)bool

Define a new category @param[in] categoryName Name of the new category @param[in] categoryDescription Description of the category @return false if there was already a category with the given name

static get_all_categories()object

Get the list of available categories and their descriptions. :returns: description dictionary if it succeeded, else None :rtype: Dictionary with categories as a name

static get_node_categories(node_id: object)object

Return the list of categories that have been applied to the node. :param node_id: The node, or path to the node, whose categories are to be found :type node_id: Union[str, Node]

Returns

A list of category names applied to the node if it succeeded, else None

static get_node_type_categories(node_type_id: object)object

Return the list of categories that have been applied to the node type. :param node_type_id: The node type, or name of the node type, whose categories are to be found :type node_type_id: Union[str, NodeType]

Returns

A list of category names applied to the node type if it succeeded, else None

remove_category(self: omni.graph.core._omni_graph_core.INodeCategories, arg0: str)bool

Remove an existing category, mainly to manage the ones created by a node type for itself @param[in] categoryName Name of the category to remove @return false if there was no category with the given name

class omni.graph.core.ISchedulingHints
property compute_rule
get_data_access(self: omni.graph.core._omni_graph_core.ISchedulingHints, arg0: omni.graph.core._omni_graph_core.eAccessLocation)omni.graph.core._omni_graph_core.eAccessType

Get the type of access the node has for a given data type @param[in] dataType Type of data for which access type is being modified @returns Value of the access type flag

inspect(self: omni.graph.core._omni_graph_core.ISchedulingHints, arg0: omni::core::Api<omni::inspect::IInspector_abi>)bool

Runs the inspector on the scheduling hints.

@param[in] inspector The inspector class @return true if the inspection ran successfully, false if the inspection type is not supported

set_data_access(self: omni.graph.core._omni_graph_core.ISchedulingHints, arg0: omni.graph.core._omni_graph_core.eAccessLocation, arg1: omni.graph.core._omni_graph_core.eAccessType)None

Set the flag describing how a node accesses particular data in its compute _abi(defaults to no access). Setting any of these flags will automatically mark the node as “not threadsafe”. @param[in] dataType Type of data for which access type is being modified @param[in] newAccessType New value of the access type flag

property thread_safety
class omni.graph.core.IVariable
property category
property display_name
get(self: omni.graph.core._omni_graph_core.IVariable, graph_context: omni::graph::core::Py_GraphContext)object
Parameters

graph_context (omni.graph.core.GraphContext) – The GraphContext object to get the variable value from.

Returns

Value of the attribute data

Return type

(Any)

get_array(self: omni.graph.core._omni_graph_core.IVariable, graph_context: omni::graph::core::Py_GraphContext, get_for_write: bool = False, reserved_element_count: int = 0)object
Parameters
  • graph_context (omni.graph.core.GraphContext) – The GraphContext object to get the variable value from.

  • get_for_write (bool) – Should the data be retrieved for writing?

  • reserved_element_count (int) – If the data is to be retrieved for writing, preallocate this many elements

Returns

Value of the attribute’s data

Return type

(Any)

property name
property scope
set(self: omni.graph.core._omni_graph_core.IVariable, graph_context: omni::graph::core::Py_GraphContext, value: object)bool

Sets the value of the attribute data

Parameters
  • graph_context (omni.graph.core.GraphContext) – The GraphContext object to store the variable value.

  • on_gpu (bool) – Is the data to be set on the GPU?

Returns

True if the value was successfully set

Return type

(bool)

property source_path
property tooltip
property type

Gets the data type of the variable.

Returns

(og.Type) The data type of the variable.

property valid
omni.graph.core.Int(x)
omni.graph.core.Int2(x)
omni.graph.core.Int3(x)
omni.graph.core.Int4(x)
omni.graph.core.Matrix2d(x)
omni.graph.core.Matrix3d(x)
omni.graph.core.Matrix4d(x)
class omni.graph.core.MemoryType

Members:

CPU

CUDA

ANY

ANY = MemoryType.ANY
CPU = MemoryType.CPU
CUDA = MemoryType.CUDA
property name

handle) -> str

Type

(self

class omni.graph.core.MetadataKeys

Holder for common metadata information These should match the C++ constant values found in include/omni/graph/core/ogn/Database.h as well as the members of MetadataKeyOutput below.

ALLOWED_TOKENS = 'allowedTokens'
ALLOWED_TOKENS_RAW = '__allowedTokens'
CATEGORIES = '__categories'
CATEGORY_DESCRIPTIONS = '__categoryDescriptions'
CUDA_POINTERS = '__cudaPointers'
DEFAULT = '__default'
DESCRIPTION = '__description'
EXCLUSIONS = '__exclusions'
EXTENSION = '__extension'
HIDDEN = 'hidden'
ICON_BACKGROUND_COLOR = '__iconBackgroundColor'
ICON_BORDER_COLOR = '__iconBorderColor'
ICON_COLOR = '__iconColor'
ICON_PATH = '__icon'
LANGUAGE = '__language'
LITERAL_ONLY = 'literalOnly'
MEMORY_TYPE = '__memoryType'
OBJECT_ID = '__objectId'
OPTIONAL = '__optional'
OUTPUT_ONLY = 'outputOnly'
SINGLETON = '__singleton'
TAGS = 'tags'
TOKENS = '__tokens'
UI_NAME = 'uiName'
class omni.graph.core.Node
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, value: object = None, extendedType: omni.graph.core._omni_graph_core.ExtendedAttributeType = ExtendedAttributeType.EXTENDED_ATTR_TYPE_REGULAR, 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

Return None

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

Return None

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.

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)int

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._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

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_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

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::graph::core::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

class omni.graph.core.NodeController

Helper class that provides a simple interface to modifying the contents of a node

static create_attribute(node: Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed], attr_name: str, attr_type: Union[str, omni.graph.core._omni_graph_core.Type], attr_port: Optional[omni.graph.core._omni_graph_core.AttributePortType] = AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT, attr_default: Optional[Any] = None, attr_extended_type: Optional[Union[omni.graph.core._omni_graph_core.AttributePortType, Tuple[omni.graph.core._omni_graph_core.AttributePortType, Union[str, List[str]]]]] = ExtendedAttributeType.EXTENDED_ATTR_TYPE_REGULAR)Optional[omni.graph.core._omni_graph_core.Attribute]

Create a new dynamic attribute on the node

Parameters
  • node – Node on which to create the attribute (path or og.Node)

  • attr_name – Name of the new attribute, either with or without the port namespace

  • attr_type – Type of the new attribute, as an OGN type string or og.Type

  • attr_port – Port type of the new attribute, default is og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT

  • attr_default – The initial value to set on the attribute, default is None which means use the type’s default

  • attr_extended_type – The extended type of the attribute, default is og.ExtendedAttributeType.EXTENDED_ATTR_TYPE_REGULAR. If the extended type is og.ExtendedAttributeType.EXTENDED_ATTR_TYPE_UNION then this parameter will be a 2-tuple with the second element being a list or comma-separated string of union types

Returns

The newly created attribute, None if there was a problem creating it

static remove_attribute(attribute: Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute], node: Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]] = None)bool

Removes an existing dynamic attribute from a node.

Parameters
  • attribute – Reference to the attribute to be removed

  • node – If the attribute reference is a string the node is used to find the attribute to be removed

Returns

True if the attribute was successfully removed, else False (including when the attribute wasn’t found)

classmethod safe_node_name(node_type_name: str, abbreviated: bool = False)str

Returns a USD-safe node name derived from the node_type_name

Parameters
  • node_type_name – Fully namespaced name of the node type (e.g. omni.graph.nodes.Clamp)

  • abbreviated – If True then remove the namespace, else just make the separators into underscores

Returns

A safe node name that roughly corresponds to the given node type name

class omni.graph.core.NodeEvent

Node modification event.

Members:

CREATE_ATTRIBUTE

REMOVE_ATTRIBUTE

ATTRIBUTE_TYPE_RESOLVE

ATTRIBUTE_TYPE_RESOLVE = NodeEvent.ATTRIBUTE_TYPE_RESOLVE
CREATE_ATTRIBUTE = NodeEvent.CREATE_ATTRIBUTE
REMOVE_ATTRIBUTE = NodeEvent.REMOVE_ATTRIBUTE
property name

handle) -> str

Type

(self

class omni.graph.core.NodeType
add_extended_input(self: omni.graph.core._omni_graph_core.NodeType, name: str, type: str, is_required: bool, extended_type: omni.graph.core._omni_graph_core.ExtendedAttributeType)None

Adds an extended input type to this node type. Every node of this node type would then have this input.

Parameters
  • arg0 (str) – The name of the input

  • arg1 (str) – Extra information for the type - for union types, this is a list of types of this union, comma separated For example, “double,float”

  • getDefault (bool) –

  • arg2 (ExtendedAttributeType) –

add_extended_output(self: omni.graph.core._omni_graph_core.NodeType, name: str, type: str, is_required: bool, extended_type: omni.graph.core._omni_graph_core.ExtendedAttributeType)None

Adds an extended output type to this node type. Every node of this node type would then have this output.

Parameters
  • arg0 (str) – The name of the output

  • arg1 (str) – Extra information for the type - for union types, this is a list of types of this union, comma separated For example, “double,float”

  • getDefault (bool) –

  • arg2 (ExtendedAttributeType) –

add_extended_state(self: omni.graph.core._omni_graph_core.NodeType, name: str, type: str, is_required: bool, extended_type: omni.graph.core._omni_graph_core.ExtendedAttributeType)None

Adds an extended state type to this node type. Every node of this node type would then have this state.

Parameters
  • arg0 (str) – The name of the state

  • arg1 (str) – Extra information for the type - for union types, this is a list of types of this union, comma separated For example, “double,float”

  • getDefault (bool) –

  • arg2 (ExtendedAttributeType) –

add_input(self: omni.graph.core._omni_graph_core.NodeType, name: str, type: str, is_required: bool)None

Adds an input to this node type. Every node of this node type would then have this input.

Parameters
  • arg0 (str) – The name of the input

  • arg1 (str) – The type name of the input

  • write (bool) –

add_output(self: omni.graph.core._omni_graph_core.NodeType, name: str, type: str, is_required: bool)None

Adds an output to this node type. Every node of this node type would then have this output.

Parameters
  • arg0 (str) – The name of the output

  • arg1 (str) – The type name of the output

  • write (bool) –

add_state(self: omni.graph.core._omni_graph_core.NodeType, name: str, type: str, is_required: bool)None

Adds an state to this node type. Every node of this node type would then have this state.

Parameters
  • arg0 (str) – The name of the state

  • arg1 (str) – The type name of the state

  • write (bool) –

get_all_categories(self: omni.graph.core._omni_graph_core.NodeType)list

Returns a list of all categories associated with this node type

get_all_metadata(self: omni.graph.core._omni_graph_core.NodeType)dict

Returns a dictionary of metadata on the node type.

get_all_subnode_types(self: omni.graph.core._omni_graph_core.NodeType)dict

Finds all subnode types of the current node type.

Returns

Dictionary of type_name:type_object for all subnode types of this one

Return type

(dict[str, og.NodeType])

get_metadata(self: omni.graph.core._omni_graph_core.NodeType, key: str)str

Returns the metadata value for the given key.

Parameters

arg0 (str) – The metadata keyword

Returns

Metadata value for the given keyword, or None if it is not defined

Return type

(str)

get_metadata_count(self: omni.graph.core._omni_graph_core.NodeType)int

Returns the number of metadata values currently defined on the node type.

get_node_type(self: omni.graph.core._omni_graph_core.NodeType)str

Returns the name of the node type.

get_scheduling_hints(self: omni.graph.core._omni_graph_core.NodeType)omni.graph.core._omni_graph_core.ISchedulingHints

Gets the set of scheduling hints currently set on the node type.

Returns

The scheduling hints for this node type

Return type

(og.SchedulingHints)

has_state(self: omni.graph.core._omni_graph_core.NodeType)bool

Returns True if the node has internal state data, False if not.

inspect(self: omni.graph.core._omni_graph_core.NodeType, inspector: omni::core::Api<omni::inspect::IInspector_abi>)bool

Runs the inspector on the node type

Parameters

arg0 (omni.inspect.Inspector) – The inspector to run

Returns

True if the inspector was successfully run on the node type, False if it is not supported

Return type

(bool)

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

Returns whether the current node type is valid.

set_has_state(self: omni.graph.core._omni_graph_core.NodeType, has_state: bool)None

Sets the boolean indicating a node has state.

Parameters

arg0 (bool) – Whether the node has state or not

set_metadata(self: omni.graph.core._omni_graph_core.NodeType, key: str, value: str)bool

Sets the metadata value for the given key.

Parameters
  • arg0 (str) – The metadata keyword

  • arg1 (str) – The value of the metadata

set_scheduling_hints(self: omni.graph.core._omni_graph_core.NodeType, scheduling_hints: omni.graph.core._omni_graph_core.ISchedulingHints)None

Modify the scheduling hints defined on the node type.

Parameters

scheduling_hints (og.SchedulingHints) – New set of scheduling hints for the node type

omni.graph.core.Normal3d(x)
omni.graph.core.Normal3f(x)
omni.graph.core.Normal3h(x)
class omni.graph.core.ObjectLookup

Helper to extract OmniGraph types from various types of descriptions for them.

These functions take flexible spec types that identify attributes, nodes, or graphs. In most cases the spec types can be either one of or a list of the objects being used or found by the functions. The forms each spec type can take are as follows:

GraphSpec_t
NodeSpec_t
AttributeSpec_t
  • An omni.graph.core.Attribute object

  • A string containing the full path to the omni.graph.core.Attribute object on the USD stage

  • An Sdf.Path containing the full path to the omni.graph.core.Attribute object on the USD stage

  • A Usd.Attribute that is the USD backing of an omni.graph.core.Attribute object

  • A 2-tuple consisting of a string and a NodeSpec_t, where the string is the omni.graph.core.Attribute object’s name within the omni.graph.core.Node

  • A list of any of the above

Prim_t
  • A Usd.Prim or Usd.Typed object

  • A string containing the path to a Usd.Prim or Usd.Typed object

  • An Sdf.Path containing the path to a Usd.Prim or Usd.Typed object

  • A NodeSpec_t, identifying a node whose USD backing Usd.Prim or Usd.Typed object is to be returned

  • A list of any of the above

classmethod attribute(attribute_id: Union[omni.graph.core._omni_graph_core.Attribute, str, pxr.Sdf.Path, Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]], Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed], Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]], List[Union[omni.graph.core._omni_graph_core.Attribute, str, pxr.Sdf.Path, Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]], Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed], Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]]]]], node_id: Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]] = None, graph_id: Optional[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]] = None)Union[omni.graph.core._omni_graph_core.Attribute, List[omni.graph.core._omni_graph_core.Attribute]]

Returns the OmniGraph attribute(s) corresponding to the variable type parameter

Parameters
  • attribute_id

    Information on which attribute to look for. If a list then get all of them. The attribute_id can take several forms, for maximum flexibility:

    • a 2-tuple consisting of the attribute name as str and a node spec. The named attribute must exist on the node - e.g. (“inputs:value”, my_node) or (“inputs:value”, “/Graph/MyNode”). This is equivalent to passing in the attribute and node spec as two different parameters. You’d use this form when requesting several attributes from different nodes rather than a bunch of attributes from the same node.

    • a str or Sdf.Path pointing directly to the attribute - e.g. “/Graph/MyNode/inputs:value”

    • a str that’s an attribute name, iff the node_id is also specified

    • a Usd.Attribute pointing to the attribute’s reference on the USD side

  • node_id – Node to which the attribute belongs, when only the attribute’s name is provided

  • graph_id – Graph to which the node and attribute belong.

Returns

Attribute(s) matching the description(s) - None where there is no match

Raises
  • og.OmniGraphError if the attribute description wasn't one of the recognized types, if

  • any of the attributes could not be found, or if there was a mismatch in node or graph and attribute.

classmethod attribute_path(attribute_spec: Union[omni.graph.core._omni_graph_core.Attribute, str, pxr.Sdf.Path, Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]], Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed], Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]]])str

Infers an attribute path from a spec where the attribute may or may not exist

Parameters

attribute_spec – Location of where the attribute would be, if it exists

Returns

Location of the attribute, if it exists

Raises

og.OmniGraphError – If there was something inconsistent in the attribute spec or a path could not be inferred

classmethod attribute_type(type_id: Union[str, omni.graph.core._omni_graph_core.Type, omni.graph.core._omni_graph_core.Attribute, omni.graph.core._omni_graph_core.AttributeData])omni.graph.core._omni_graph_core.Type

Returns the OmniGraph attribute type corresponding to the variable type parameter.

All legal OGN types are recognized, as well as the UNKNOWN type.

Parameters

type_id

Variable description of the attribute type object as:

  • An omni.graph.core.Type object

  • An OGN-style type description - e.g. “float[3]”

  • An Sdf-style type description - e.g. “float3”

  • An omni.graph.core.Attribute whose (resolved) type is to be retrieved

  • An omni.graph.core.AttributeData whose (resolved) type is to be retrieved

Returns

Attribute type matching the description

Raises

og.OmniGraphError if the attribute type description wasn't one of the recognized types

classmethod graph(graph_id: Optional[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph, List[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]]]])Union[omni.graph.core._omni_graph_core.Graph, List[omni.graph.core._omni_graph_core.Graph]]

Returns the OmniGraph graph(s) corresponding to the variable type parameter

Parameters

graph_id – Information for the graph to find. If a list then iterate over the list

Returns

Graph(s) corresponding to the description(s) in the current scene, None where there is no match

Raises

og.OmniGraphError if a graph matching the identifier wasn't found

classmethod node(node_id: Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed, Tuple[str, Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]], List[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed, Tuple[str, Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]]]]], graph_id: Optional[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]] = None)Union[omni.graph.core._omni_graph_core.Node, List[omni.graph.core._omni_graph_core.Node]]

Returns the OmniGraph node(s) corresponding to the variable type parameter

Parameters
  • node_id – Information for the node to find. If a list then iterate over the list

  • graph_id – Identifier for graph to which the node belongs.

Returns

Node(s) corresponding to the description(s) in the current graph, None where there is no match

Raises
  • og.OmniGraphError – node description wasn’t one of the recognized types or if a mismatched graph was passed in

  • og.OmniGraphValueError – If the node description did not match a node in the graph

classmethod node_path(node_spec: Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed, Tuple[str, Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]]])str

Infers a node path from a spec where the node may or may not exist

Parameters

node_spec – Description of a path to a node that may or may not exist

Returns

The path inferred from the node spec. No assumption should be made about the validity of the path.

Raises

og.OmniGraphError – If there was something inconsistent in the node spec or a path could not be inferred

classmethod node_type(type_id: Union[str, omni.graph.core._omni_graph_core.NodeType, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim, pxr.Usd.Typed, List[Union[str, omni.graph.core._omni_graph_core.NodeType, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim, pxr.Usd.Typed]]])Union[omni.graph.core._omni_graph_core.NodeType, List[omni.graph.core._omni_graph_core.NodeType]]

Returns the OmniGraph node type corresponding to the variable type parameter

Parameters

type_id

Information used to identify the omni.graph.core.NodeType object.

  • an omni.graph.core.NodeType object

  • a string that is the unique identifier of the node type

  • an omni.graph.core.Node whose type is to be returned

  • a Usd.Prim or Usd.Typed that is the USD backing of an omni.graph.core.Node whose type is to be returned

  • a list of any combination of the above

Returns

Node type(s) matching the description

Raises

og.OmniGraphError if the node type description wasn't one of the recognized types or could not be found

classmethod prim(prim_id: Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed, List[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]]])Union[pxr.Usd.Prim, List[pxr.Usd.Prim]]

Returns the prim(s) corresponding to the node descriptions

Parameters

prim_id – Information for the node to find. If a list then iterate over the list

Returns

Prim(s) corresponding to the description(s) in the current graph, None where there is no match

Raises

og.OmniGraphError if the node description didn't correspond to a valid prim.

classmethod prim_path(prim_ids: Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed, List[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]]])Union[str, List[str]]

Infers a prim path from a spec where the prim may or may not exist

Parameters

prim_ids – Identifier of a prim or list of prims that may or may not exist

Returns

The path(s) inferred from the prim spec(s). No assumption should be made about their validity.

Raises

og.OmniGraphError – If there was something inconsistent in the prim spec or a path could not be inferred

classmethod split_graph_from_node_path(node_path: Union[str, pxr.Sdf.Path])Tuple[omni.graph.core._omni_graph_core.Graph, str]

Find the lowest level graph from a node path

The path /World/Graph1/Graph2/Node1/Node2 would return the og.Graph at /World/Graph1/Graph2 and the relative node path “Node1/Node2”.

Parameters

node_path – Full path to the node from the root

Returns

(graph, node_path) where graph is the lowest graph in the tree and node_path is the relative path to the node from the graph

classmethod usd_attribute(attribute_specs: Union[omni.graph.core._omni_graph_core.Attribute, str, pxr.Sdf.Path, Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]], Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed], Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]], List[Union[omni.graph.core._omni_graph_core.Attribute, str, pxr.Sdf.Path, Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]], Tuple[str, Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed], Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph]]]]])Union[pxr.Usd.Attribute, List[pxr.Usd.Attribute]]

Returns the Usd.Attribute(s) corresponding to the attribute descriptions

Parameters

attribute_specs – Location or list of locations from which to infer a matching Usd.Attribute

Returns

Usd.Attribute(s) corresponding to the description(s) in the current graph

Raises

og.OmniGraphError if the attribute description didn't correspond to a valid Usd.Attribute.

exception omni.graph.core.OmniGraphError(*args, **kwargs)

Exception to raise when there is an error in an OmniGraph operation

SHOW_STACK_TRACE = False
classmethod set_show_stack_trace(enable_traces: bool)

Turn on or off display of stack traces when an OmniGraphError is raised

class omni.graph.core.OmniGraphHelper(omnigraph: Optional[omni.graph.core._omni_graph_core.Graph] = None)

Class to provide a simple interface to OmniGraph manipulation functions

Provides functions for creating nodes, making and breaking connections, and setting values. Graph manipulation functions are undoable, value changes are not.

The main benefit this class provides over direct manipulation of the graph is that it accepts a variety of types for its operations. e.g. a connection could take an OmniGraph Node, a USD Prim, or a string indicating the path to the node.

graph

The OmniGraph on which operations will be performed.

Raises

OmniGraphError – If there is not enough information to perform the requested operation

BUNDLE_TYPE = 1
PRIM_TYPE = 0
REGULAR_TYPE = 2
UNKNOWN = -1
attach_to_prim(prim: Union[pxr.Usd.Prim, str])omni.graph.core._omni_graph_core.Node

Create a new compute node attached to an ordinary USD prim.

Parameters

prim – Prim node or name of prim node to which the OmniGraph node should attach

Returns

OmniGraph Prim type node associated with the passed in Prim

connect(src_node: Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim]], src_attr: Union[str, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute], dst_node: Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim]], dst_attr: Union[str, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute])

Create a connection between two attributes

Parameters
  • src_node – Node on the source (input) end of the connection. Ignored if src_attr is an og.Attribute

  • src_attr – Attribute on the source (input) end of the connection. (If None then it’s a prim connection)

  • dst_node – Node on the destination (output) end of the connection. Ignored if dst_attr is an og.Attribute

  • dst_attr – Attribute on the destination (output) end of the connection.

Raises

OmniGraphError – If nodes or attributes could not be found, or connection fails

context()

Returns the evaluation context for the graph to which this helper is attached

create_attribute(node: Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim]], attr_name: str, attr_type: Union[str, omni.graph.core._omni_graph_core.Type], attr_port: Optional[omni.graph.core._omni_graph_core.AttributePortType] = AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT, attr_default: Optional[Any] = None, attr_extended_type: Optional[Union[omni.graph.core._omni_graph_core.AttributePortType, Tuple[omni.graph.core._omni_graph_core.AttributePortType, Union[str, List[str]]]]] = ExtendedAttributeType.EXTENDED_ATTR_TYPE_REGULAR)Optional[omni.graph.core._omni_graph_core.Attribute]

Create a new dynamic attribute on the node

Parameters
  • node – Node on which to create the attribute (path or og.Node)

  • attr_name – Name of the new attribute, either with or without the port namespace

  • attr_type – Type of the new attribute, as an OGN type string or og.Type

  • attr_port – Port type of the new attribute, default is og.AttributePortType.ATTRIBUTE_PORT_TYPE_INPUT

  • attr_default – The initial value to set on the attribute, default is None

  • attr_extended_type – The extended type of the attribute, default is og.ExtendedAttributeType.EXTENDED_ATTR_TYPE_REGULAR. If the extended type is og.ExtendedAttributeType.EXTENDED_ATTR_TYPE_UNION then this parameter will be a 2-tuple with the second element being a list or comma-separated string of union types

Returns

The newly created attribute, None if there was a problem creating it

create_node(node_path: str, node_type: str, allow_exists: bool = False, version: Optional[int] = None)omni.graph.core._omni_graph_core.Node

Create an OmniGraph node of the given type and version at the given path.

Parameters
  • node_path – SdfPath to the node in the stage

  • node_type – Type of node to create

  • check_exists – If true then succeed if a node with matching path, type, and version already exists

  • version – Version of the node type to create. By default it creates the most recent.

Raises

OmniGraphError – If the node already existed

Returns

OmniGraph node added to the scene, or None if it could not be created

create_prim(prim_path: str, attribute_info: Dict[str, Tuple[Union[str, omni.graph.core._omni_graph_core.Type], Any]])

Create a prim node containing a predefined set of attribute values and a ReadPrim OmniGraph node for it

Parameters
  • prim_path – Location of the prim

  • attribute_info – Dictionary of {NAME: (TYPE, VALUE)} for all prim attributes The TYPE is in OGN format, so “float[3][]”, “bundle”, etc. The VALUE should be in a format suitable for passing to pxr::UsdAttribute.Set()

Returns

og.Node of the created node

delete_node(node: Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim]], allow_noexists: bool = False)bool

Deletes an OmniGraph node at the given path.

Parameters
  • node – node to be deleted

  • allow_noexists – If true then succeed if no node with matching path exists

Raises

OmniGraphError – If the node does not exist

Returns

True if the node is gone

disconnect(src_node: Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim]], src_attr: Union[str, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute], dst_node: Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim]], dst_attr: Union[str, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute])

Break a connection between two attributes

Parameters
  • src_node – Node on the source (input) end of the connection. Ignored if src_attr is an og.Attribute

  • src_attr – Attribute on the source (input) end of the connection. If None then it is a prim connection.

  • dst_node – Node on the destination (output) end of the connection. Ignored if dst_attr is an og.Attribute

  • dst_attr – Attribute on the destination (output) end of the connection.

Raises

OmniGraphError – If nodes or attributes could not be found, connection didn’t exist, or disconnection fails

disconnect_all(attr: Union[str, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute], node: Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim]] = None)

Break all connections to and from an attribute

Parameters
  • attr – Attribute on the source (input) end of the connection. If None then it is a prim connection.

  • node – Node on the source (input) end of the connection. Ignored if attr is an og.Attribute

Raises

OmniGraphError – If nodes or attributes could not be found, connection didn’t exist, or disconnection fails

edit(graph_description: Dict[str, Any])List[omni.graph.core._omni_graph_core.Node]

Modify an OmniGraph relative to the top level of the scene (“/”) Convenience function for accessing edit_graph without a root prim when it’s not relevant

edit_graph(root_prim: str, graph_description: Dict[str, Any])List[omni.graph.core._omni_graph_core.Node]

Create an OmniGraph node graph from a dictionary description of the contents.

Here’s a simple call that first deletes an existing node “oldnode”, then creates two nodes of type “omni.graph.tutorials.SimpleData”, connects their “a_int” attributes, disconnects their “a_float” attributes and sets the input “a_int” of the source node to the value 5. It also creates two unused USD Prim nodes, one with a float attribute named “attrFloat” with value 2.0, and the other with a boolean attribute named “attrBool” with the value true.

helper = OmniGraphHelper()
(src_node, dst_node) = helper.edit_graph("/", {
    "deletions" [
        "oldnode"
    ],
    "nodes": [
        ("omni.graph.tutorials.SimpleData", "src"),
        ("omni.graph.tutorials.SimpleData", "dst")
        ],
    "prims": [
        ("Prim1", {"attrFloat": ("float", 2.0)),
        ("Prim2", {"attrBool": ("bool", true)),
        ],
    "connections": [
        ("src", "outputs:a_int", "dst", "inputs:a_int")
        ],
    "disconnections": [
        ("src", "outputs:a_float", "dst", "inputs:a_float")
        ],
    "values": [
        ("src", "inputs:a_int", 5)
        ]
    }
)
Parameters
  • root_prim – Top level prim for the graph nodes (e.g. “/”)

  • graph_description – Dictionary of graph construction definitions. A strict set of keys is accepted. Each

  • the values in the dictionary can be either a single value or a list of values of the proscribed type. (of) –

  • "deletions" (-) –

    [NODE_NAME]

    Deletes a node at the given path

  • "nodes" (-) –

    [(NODE_TYPE, NODE_NAME)]

    Constructs a node of type “NODE_TYPE” and name “NODE_NAME”.

  • "prims" (-) –

    [(PRIM_PATH, {ATTR_NAME: (ATTR_TYPE, ATTR_VALUE)})]

    Constructs a prim with path “PRIM_PATH containing a set of attributes with specified types and values.

  • "connections" (-) –

    [(SRC_NODE_NAME, SRC_ATTR_NAME, DST_NODE_NAME, DST_ATTR_NAME)]

    Makes a connection between the given source and destination attributes

  • "disconnections" (-) –

    [(SRC_NODE_NAME, SRC_ATTR_NAME, DST_NODE_NAME, DST_ATTR_NAME)]

    Breaks a connection between the given source and destination attributes

  • "values" (-) –

    [(NODE_NAME, ATTR_NAME, VALUE)]

    Sets the value of the given list of attributes.

  • that when constructing nodes the "NODE_NAME" may be in use (Note) –

  • a map is constructed when (so) –

  • nodes are created between the requested node name and the actual node created (the) –

  • will (which) –

  • the prim path reference. (contain) –

  • happen in that order (Operations) –

  • possibility of errors. As a shortform any of the keys can accept a single tuple as well as a (the) –

  • of tuples. (list) –

Returns

The list of og.Nodes created for all constructed nodes

Raises
  • OmniGraphError if any of the graph creation instructions could not be fulfilled

  • The graph will be left in the partially constructed state it reached at the time of the error

async evaluate()

Wait for the next Graph evaluation cycle - await this function to ensure it is finished before returning. If the graph evaluation time is not incremented after 10 application updates, RuntimeError is raised.

static get_attr_type(attr: Union[omni.graph.core._omni_graph_core.Attribute, omni.graph.core._omni_graph_core.AttributeData])

Get the type for the given attribute, taking in to account extended type

Parameters

attr – Attribute whose type is to be determined

Returns

The type of the attribute

static get_attr_type_name(attr)

Get the type name for the given attribute, taking in to account extended type

Parameters

attr – Attribute whose type is to be determined

Returns

The type name of the attribute

get_attribute_data_values(data_to_get: List[omni.graph.core._omni_graph_core.AttributeData])List[Any]

Get the values from a list of defined attributes

Parameters

data_to_get – List of attribute data whose values are to be retrieved

Returns

List of values corresponding to the list of attribute data passed in

get_attribute_values(attributes_to_get: List[omni.graph.core._omni_graph_core.Attribute])List[Any]

Get the values from a list of defined attributes

Parameters

attributes_to_get – List of attributes whose values are to be retrieved

Returns

List of values corresponding to the list of attributes passed in

get_prim_path(node: Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim]])

Returns the prim path corresponding to the variable type parameter

get_values(node: Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim]], attributes_to_get: Union[str, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute, List[Union[str, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute]]])List[Any]

Get the values from attributes on a node

This is general purpose for handling all types of node and attribute descriptions. If you already have the og.Attributes whose values you wish to retrieve then call get_attribute_values() instead.

Parameters
  • node – Description of node whose values are to be read

  • attributes_to_get – One or a list of descriptions of attributes whose values are to be retrieved

Raises

OmniGraphError – If nodes or attributes could not be found, or values could not be read

Returns

One or a list of values corresponding to the attributes passed in

node_as_prim(node: Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim]])pxr.Usd.Prim

Returns the prim corresponding to the variable type parameter

omnigraph_attribute(node: Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim]], attribute_info: Union[str, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute, List[Union[str, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute]]])Union[omni.graph.core._omni_graph_core.Attribute, List[omni.graph.core._omni_graph_core.Attribute]]

Returns the OmniGraph attribute(s) corresponding to the variable type parameter

Parameters
  • node – Node to which the attribute belongs. Ignored if attribute_info is an og.Attribute

  • attribute_info – Information on which attribute to look for. If a list then get all of them

Returns

Attribute(s) matching the description(s) - None where there is no match

Raises
  • OmniGraphError if the attribute description wasn't one of the recognized types, or if

  • any of the attributes could not be found

omnigraph_node(node_info: Union[str, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim, None, List[Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim]]]])Union[omni.graph.core._omni_graph_core.Node, List[omni.graph.core._omni_graph_core.Node]]

Returns the OmniGraph node(s) corresponding to the variable type parameter

Parameters

node_info – Information for the node to find. If a list then iterate over the list

Returns

Node(s) corresponding to the description(s) in the current graph, None where there is no match

Raises

OmniGraphError if the node description wasn't one of the recognized types

remove_attribute(attribute: Union[str, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute], node: Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim]] = None)bool

Removes an existing dynamic attribute from a node.

Parameters
  • attribute – Name of the attribute to be removed

  • node – If not None and the attribute is specified as a string then this is the node on which it lives

Returns

True if the attribute was successfully removed, else False

static safe_node_name(node_type_name: str, abbreviated: bool = False)str

Returns a USD-safe node name derived from the node_type_name (stripping namespace)

Parameters
  • node_type_name – Fully namespaced name of the node type

  • abbreviated – If True then remove the namespace, else just make the separators into underscores

Returns

A safe node name that roughly corresponds to the given node type name

set_attribute_data_values(values_to_set: List[Tuple[omni.graph.core._omni_graph_core.AttributeData, Any]], graph: Optional[omni.graph.core._omni_graph_core.Graph] = None)

Set a bunch of attribute data values

Parameters

values_to_set – List of (AttributeData, Value) pairs which are the values to be set

Raises

OmniGraphError – If values could not be set

set_attribute_values(values_to_set: List[Tuple[omni.graph.core._omni_graph_core.Attribute, Any]], ignore_usd: bool = False)

Set a bunch of attribute values

Dict values can be used to specify a type in additional to a value. If the attribute is unresolved, it will be resolved to that type before setting the value. For example:

set_attribute_values([(attrib, {“type”: “float2”, “value”: (1.0, 2.0)})])

Parameters
  • values_to_set – List of (Attribute, Value) pairs which are the values to be set.

  • ignore_usd – If False then report any problems updating the USD attributes

Raises

OmniGraphError – If values could not be set

set_values(node: Optional[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Usd.Prim]], values_to_set: Union[Tuple[Union[str, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute], Any], List[Tuple[Union[str, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute], Any]]], ignore_usd: bool = False)

Set a bunch of attribute values on a single node

This is general purpose for handling all types of node and attribute descriptions. If you already have the og.Attributes whose values you wish to set then call set_attribute_values() instead.

Parameters
  • node – Node on which the values are to be set

  • values_to_set – List or single element of (Attribute, Value) pairs which are the values to be set

  • ignore_usd – If False then report any problems updating the USD attributes

Raises

OmniGraphError – If nodes or attributes could not be found, or values could not be set

class omni.graph.core.OmniGraphInspector

Provides simple interfaces for inspection of OmniGraph objects

as_json(omnigraph_object: Union[omni.graph.core._omni_graph_core.Graph, omni.graph.core._omni_graph_core.GraphContext, omni.graph.core._omni_graph_core.GraphRegistry, omni.graph.core._omni_graph_core.NodeType], file_path: Optional[str] = None, flags: List[str] = [])str

Outputs the JSON format data belonging to the context (for debugging)

Parameters
  • omnigraph_object – Object whose memory use is to be inspected

  • file_path – If a string then dump the output to a file at that path, otherwise return a string with the dump

  • flags – Set of enabled flags on the inspection object. Valid values are: maps: Show all of the attribute type maps (lots of redundancy here, and independent of data present) noDataDetails: Hide the minutiae of where each attribute’s data is stored in FlatCache

Returns

If no file_path was specified then return the inspected data. If a file_path was specified then return the path where the data was written (should be the same)

Raises

OmniGraphError – If the object type doesn’t support memory inspection

as_text(omnigraph_object: Union[omni.graph.core._omni_graph_core.Graph, omni.graph.core._omni_graph_core.GraphContext, omni.graph.core._omni_graph_core.GraphRegistry, omni.graph.core._omni_graph_core.NodeType], file_path: Optional[str] = None)str

Returns the serialized data belonging to the context (for debugging)

Parameters
  • omnigraph_object – Object whose memory use is to be inspected

  • file_path – If a string then dump the output to a file at that path, otherwise return a string with the dump

Returns

If no file_path was specified then return the inspected data. If a file_path was specified then return the path where the data was written (should be the same)

Raises

OmniGraphError – If the object type doesn’t support memory inspection

attribute_locations(context: omni.graph.core._omni_graph_core.GraphContext)Dict[str, Dict[str, int]]

Find all of the attribute data locations within FlatCache for the given context.

Parameters

context – Graph context whose FlatCache data is to be inspected

Returns

attribute memory location }

Return type

Dictionary with KEY = path, VALUE = { attribute name

attribute_redirections(context: omni.graph.core._omni_graph_core.GraphContext)Dict[str, Dict[str, int]]

Find all of the attribute data in FlatCache for the given context that has been redirected to another location.

Parameters

context – Graph context whose FlatCache data is to be inspected

Returns

Dictionary with KEY = Name of Original, VALUE = Name of Redirection Location

available()bool

Returns true if the inspection capabilities are available

memory_use(omnigraph_object: Union[omni.graph.core._omni_graph_core.Graph, omni.graph.core._omni_graph_core.GraphContext, omni.graph.core._omni_graph_core.GraphRegistry, omni.graph.core._omni_graph_core.NodeType])int

Returns the number of bytes of memory used by the object, if it supports it

Parameters

omnigraph_object – Object whose memory use is to be inspected

Raises

OmniGraphError – If the object type doesn’t support memory inspection

class omni.graph.core.OmniGraphPerformance

Provides simple interfaces for measuring performance of OmniGraph.

For simplicity, the collection is kept separate from the interpretation of the data. That way multiple collections can be made and summarized separately.

Normal usage is something like this:

p = og.OmniGraphPerformance() p.start_monitor() profile_task = asyncio.create_task(measure_results()) p.end_monitor()

async def measure_results():

timing_task = p.measure_timing() await timing_task ids = timing_task.result() display(ids, p.average_node_evaluation_time())

Internal Members:

__capture_enabled: True when the profiler capturing is running __enabled_capture_mask: Profiler mask value to enable data capture, filtered for any settings __nodes_captured: Union of all nodes in the various capture sessions; for convenience when reporting __iprofiler: Interface for the profiler to collect CPU timing __iprofiler_monitor: Interface for the profiler loading of collecting timing data __old_capture_mask: Saved capture mask when the profiler is engaged (None when not running) __results: List of dictionaries with timing results __settings: Access to profiler settings

available()bool

Returns true if the profiling capabilities are available

average_event_time(event_regex: str)Dict[str, float]

Average out the named event timing information for all runs for each node.

Parameters

event_regex – Regular expression identifying the event specific to the type of node data being collected

Returns

EvaluationTime for each node in the timing set.

Return type

Dictionary of NodePath

average_node_evaluation_time()Dict[str, float]

Average out the node evaluation timing information for all runs for each node.

Returns

EvaluationTime for each node in the timing set.

Return type

Dictionary of NodePath

clear()

Clear out any timing data saved so far

end_monitor()

Set up the profiler to finish capturing

async measure_timing(iterations: int = 1)List[int]

Add a set of evaluation timing information to the current data. You can either take multiple sets of timing here by setting the iterations value, or you can call this method multiple times when you make changes.

Parameters

iterations – Number of times to measure the timing.

Returns

List of IDs for the timing(s) taken.

memory_in_use()int

Return the current number of bytes in use by FlatCache

start_monitor()

Set up the profiler for capturing - must be done before measuring timing

omni.graph.core.OmniGraphTypes(*args, **kwargs)

Redirect function calls to the real class

exception omni.graph.core.OmniGraphValueError(*args, **kwargs)

Exception to raise when an OmniGraph operation encountered an illegal value

class omni.graph.core.PerNodeKeys

Set of key values for per-node data. This is data that belongs to a node, but which is only valid for Python node implementations. Any data that belongs to all node types should be implemented through the ABI.

ATTRIBUTES = 'attributes'
DYNAMIC_ATTRIBUTES = 'dynamic_attributes'
ERRORS = 'errors'
INTERNAL_STATE = 'internal_state'
NODE_CALLBACK = 'node_callback'
ROLE = 'role'
omni.graph.core.Point3d(x)
omni.graph.core.Point3f(x)
omni.graph.core.Point3h(x)
class omni.graph.core.PtrToPtrKind

Members:

NA

CPU

GPU

CPU = PtrToPtrKind.CPU
GPU = PtrToPtrKind.NA
NA = PtrToPtrKind.NA
property name

handle) -> str

Type

(self

class omni.graph.core.PublicExtension

Mandatory extension instantiation required by the Carbonite extension handler

on_after_ext_enabled(ext_id: str, *_)
on_before_ext_disabled(ext_id: str, *_)
on_shutdown()

Shutting down this part of the extension prepares it for hot reload

on_startup()

Set up initial conditions for the Python part of the extension

class omni.graph.core.PyTorchTensorDouble
property data_ptr
property device
property dtype
property ndim
property shape
class omni.graph.core.PyTorchTensorFloat
property data_ptr
property device
property dtype
property ndim
property shape
class omni.graph.core.PythonNodeRegistration(module_to_register: module, module_name: str)

Scoped object to register and deregister Python nodes as their extension is started up and shut down. This will be created and destroyed automatically by OmniGraph and does not need to be explicitly managed.

omni.graph.core.Quatd(x)
omni.graph.core.Quatf(x)
omni.graph.core.Quath(x)
exception omni.graph.core.ReadOnlyError(attribute: Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute], message: Optional[str] = None)

Exception to raise when there is a write operation on a read-only attribute (i.e. an input)

omni.graph.core.RemoveAttrCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.RemoveVariableCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.RenameNodeCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.RenameSubgraphCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.RenamedClass(cls, old_class_name: str, rename_message: Optional[str] = None)object

Syntactic sugar to provide a class deprecation that is a simple renaming, where all of the functions in the old class are still present in backwards compatible form in the new class.

Parameters
  • old_class_name – The name of the class that was renamed

  • rename_message – If not None, what to use instead of the old class. If None then assume the new class is used.

Usage:

MyDeprecatedClass = RenamedClass(MyNewClass, "MyDeprecatedClass")
class omni.graph.core.RuntimeAttribute(attribute_data: omni.graph.core._omni_graph_core.AttributeData, context: omni.graph.core._omni_graph_core.GraphContext, read_only: bool, on_gpu: Optional[bool] = None)
property abi

Returns the ABI object representing the bundled attribute’s data

array_value(*args, **kwargs)Any

Set the value of an attributeData for writing, with preallocated element space. See og.AttributeDataValueHelper.get_array() for parameters. on_gpu is provided here

copy_data(other: omni.graph.core._impl.runtime.RuntimeAttribute)bool

Copies data from another attribute, returning True if the copy succeeded, else False

property cpu_value

Get the value of an attributeData for reading, forcing it to be on the CPU

property gpu_value

Get the value of an attributeData for reading, forcing it to be on the GPU

property name

Returns the name of the attribute data. Can only be set on creation.

property size

Return the number of elements in the attribute (1 for regular data, elementCount for arrays)

property type

Returns the attribute type of the attribute data. Can only be set on creation.

property value

Get the value of an attributeData for reading

omni.graph.core.SetAttrCommand(*args, **kwargs)

Redirect function calls to the real class

omni.graph.core.SetAttrDataCommand(*args, **kwargs)

Redirect function calls to the real class

class omni.graph.core.Severity

Members:

INFO

WARNING

ERROR

ERROR = Severity.ERROR
INFO = Severity.INFO
WARNING = Severity.WARNING
property name

handle) -> str

Type

(self

omni.graph.core.TexCoord2d(x)
omni.graph.core.TexCoord2f(x)
omni.graph.core.TexCoord2h(x)
omni.graph.core.TexCoord3d(x)
omni.graph.core.TexCoord3f(x)
omni.graph.core.TexCoord3h(x)
omni.graph.core.Timecode(x)
omni.graph.core.Token(x)
class omni.graph.core.Type
property array_depth

Zero for a single value, one for an array, two for an array of arrays. (Int)

property base_type

Base type of the attribute. (omni.graph.core.BaseDataType)

get_base_type_name(self: omni.graph.core._omni_graph_core.Type)str

Returns string name of just the base data type of this type.

get_ogn_type_name(self: omni.graph.core._omni_graph_core.Type)str

Returns string name of this type in OGN format, which differs slightly from the USD format.

get_role_name(self: omni.graph.core._omni_graph_core.Type)str

Returns string name of just the role of this type.

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

Returns string name of this type.

is_compatible_raw_data(self: omni.graph.core._omni_graph_core.Type, arg0: omni.graph.core._omni_graph_core.Type)bool

Does a role-insensitive comparison with the given Type.

For example double[3] != pointd[3], but are compatible and so would return True.

Returns

Is the given type compatible with this type?

Return type

[bool]

is_matrix_type(self: omni.graph.core._omni_graph_core.Type)bool

Checks if the type one of the matrix types, whose tuples are interpreted as a square array?

Returns

True if this type is one of the matrix types

Return type

[bool]

property role

The semantic role of the type. (omni.graph.core.AttributeRole)

property tuple_count

Number of components in each tuple. 1 for a single value (scaler), 3 for a point3d, etc. (Int)

class omni.graph.core.TypeRegistry

Main singleton for storing graph objects and generating and registering functions.

classmethod add_to_graph(obj)int

Adds an object obj to the data store without checking for uniqueness of held object. Does check uniqueness of reference object.

Attributes

obj: Object to add to the data store.

Returns

the object id.

classmethod get_func(unique_name: str)Optional[omni.graph.core._impl.autonode.type_definitions.AutoNodeDefinitionWrapper]

Retrieves a function from the object store

Attributes

unique_name: function’s qualified name. Name mangling is handled by this class

Returns

Function Wrapper.

classmethod instance()

Retrieves the class instance for this singleton.

Returns

Class instance

classmethod remove_from_graph(obj_id: int)omni.graph.core._impl.autonode.type_definitions.AutographDataWrapper

Attempts to remove an object ID from the object store.

Attributes

obj_id: the object ID to be removed from the data store.

Returns

the object stored if it was found, None otherwise.

class omni.graph.core.TypedValue(value: Optional[Any] = None, type: omni.graph.core._omni_graph_core.Type = Type(BaseDataType.UNKNOWN, 1, 0))

Class that encapsulates an arbitrary value with an explicit data type. This can be used when the data type is ambiguous due to the limited set of native Python data types. For example it can differentiate between a float and double whereas in Python they are the same thing.

has_type()bool

Returns True iff the data value has an explicit type (i.e. is not type UNKNOWN)

set(*args, **kwargs)

Set the data to a specific value and/or type. The regular __init__ can be passed (VALUE, TYPE) in the simplest case; this is for more flexible setting.

The argument types are flexible and support the following syntax:

set(): Sets the data value to None and makes it an UNKNOWN type set(Any): Sets the data value and makes it an UNKNOWN type set(Any, str|og.Type): Sets the data value and defines an explicit type set(value=Any): Sets the data value and makes it an UNKNOWN type set(value=Any, type=str|og.Type): Sets the data value and defines an explicit type

No attempt is made to match the type to the value - it is assumed that if it is specified, it is correct.

Raises

og.OmniGraphError if the argument combinations are not one of the above, or the type could not be parsed

type: omni.graph.core._omni_graph_core.Type = Type(BaseDataType.UNKNOWN, 1, 0)
value: Any = None
omni.graph.core.UChar(x)
omni.graph.core.UInt(x)
omni.graph.core.Vector3d(x)
omni.graph.core.Vector3f(x)
omni.graph.core.Vector3h(x)
class omni.graph.core.WrappedArrayType(value)

Enum for the type of array data returned from the get methods

NUMPY = 1
RAW = 2
omni.graph.core.acquire_interface(plugin_name: str = None, library_path: str = None)omni::graph::core::ComputeGraph
omni.graph.core.attach(stage_id: int, mps: float)None

Attach the graph to a particular stage.

Parameters
  • stage_id (int) – The stage id of the stage to attach to

  • mps (float) – the meters per second setting for the stage

omni.graph.core.attribute_type_from_ogn_type_name(ogn_type_name: str)omni.graph.core._omni_graph_core.Type

Construct an attribute type object from an OGN style type name

omni.graph.core.attribute_type_from_usd_type_name(usd_type_name: str)omni.graph.core._omni_graph_core.Type

Construct an attribute type object from a USD style type name

omni.graph.core.attribute_value_as_usd(type: omni.graph.core._omni_graph_core.Type, value: Any)Any

Returns the value, converted into a type suitable for setting through the USD API compatible with an attribute of the given type. It’s assumed that anything passed in here has a valid USD attribute type; i.e. no extended attributes or bundles

omni.graph.core.can_set_use_schema_prims_setting(new_value: bool)str

Check to see if a new value for the schema prims setting is valid - returns warning text, empty if okay

omni.graph.core.data_shape_from_type(attribute_type: omni.graph.core._omni_graph_core.Type, is_gathered: bool = False)Tuple[omni.graph.core._impl.dtypes.Dtype, Union[None, int, Tuple[int, int], Tuple[Tuple[int, int]], Tuple[Tuple[int, int], int], Tuple[int, int, int], Tuple[int, int, Tuple[int, int]]]]

Return the dtype,shape information that corresponds to the given attribute type. For easy testing gather sizes are set to 2 items and array sizes are set to 0 elements. e.g. a gathered bool[] would return a shape of ((0, 0))

omni.graph.core.deprecated_function(deprecation_message: str)

Decorator to deprecate a function.

Parameters

deprecation_message – A description of the action the user is to take to avoid the deprecated function.

A deprecation message will only be shown once, the first time the deprecated function is called.

@deprecated_function("After version 1.5.0 use og.newer_function() instead")
def older_function():
    pass
omni.graph.core.deregister_node_type(name: str)bool

Deregisters a python subnode type with OmniGraph. See compute graph documentation for details.

Parameters

name (str) – Name of the Python node type being deregistered

Returns

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

omni.graph.core.deregister_post_load_file_format_upgrade_callback(postload_handle: int)None

De-registers the postload callback to be invoked when the file format version changes.

Parameters

postload_handle (int) – The handle that was returned during the register_post_load_file_format_upgrade_callback call

omni.graph.core.deregister_pre_load_file_format_upgrade_callback(preload_handle: int)None

De-registers the preload callback to be invoked when the file format version changes.

Parameters

preload_handle (int) – The handle that was returned during the register_pre_load_file_format_upgrade_callback call

omni.graph.core.detach()None

Detaches the graph from the currently attached stage.

class omni.graph.core.eAccessLocation

Members:

E_USD : /< Accesses the USD stage data

E_GLOBAL : /< Accesses data that is not part of the node or node type

E_STATIC : /< Accesses data that is shared by every instance of a particular node type

E_TOPOLOGY : /< Accesses information on the topology of the graph to which the node belongs

E_GLOBAL = eAccessLocation.E_GLOBAL
E_STATIC = eAccessLocation.E_STATIC
E_TOPOLOGY = eAccessLocation.E_TOPOLOGY
E_USD = eAccessLocation.E_USD
property name

handle) -> str

Type

(self

class omni.graph.core.eAccessType

Members:

E_NONE : /< There is no access to data of the associated type

E_READ : /< There is only read access to data of the associated type

E_WRITE : /< There is only write access to data of the associated type

E_READ_WRITE : /< There is both read and write access to data of the associated type

E_NONE = eAccessType.E_NONE
E_READ = eAccessType.E_READ
E_READ_WRITE = eAccessType.E_READ_WRITE
E_WRITE = eAccessType.E_WRITE
property name

handle) -> str

Type

(self

class omni.graph.core.eComputeRule

Members:

E_DEFAULT : /< Nodes are computed according to the default evaluator rules

E_ON_REQUEST : /< The evaluator may skip computing this node until explicitly requested with INode::requestCompute

E_DEFAULT = eComputeRule.E_DEFAULT
E_ON_REQUEST = eComputeRule.E_ON_REQUEST
property name

handle) -> str

Type

(self

class omni.graph.core.eThreadSafety

Members:

E_SAFE : /< Nodes can be evaluated in multiple threads safely

E_UNSAFE : /< Nodes cannot be evaluated in multiple threads safely

E_UNKNOWN : /< The thread safety status of the node type is unknown

E_SAFE = eThreadSafety.E_SAFE
E_UNKNOWN = eThreadSafety.E_UNKNOWN
E_UNSAFE = eThreadSafety.E_UNSAFE
property name

handle) -> str

Type

(self

class omni.graph.core.eVariableScope

Members:

E_PRIVATE : /< Variable is accessible only to its graph

E_READ_ONLY : /< Variable can be read by other graphs

E_PUBLIC : /< Variable can be read/written by other graphs

E_PRIVATE = eVariableScope.E_PRIVATE
E_PUBLIC = eVariableScope.E_PUBLIC
E_READ_ONLY = eVariableScope.E_READ_ONLY
property name

handle) -> str

Type

(self

omni.graph.core.extract_attribute_type_information(attribute_object: Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute, omni.graph.core._omni_graph_core.AttributeData])omni.graph.core._omni_graph_core.Type

Decompose the type of an attribute into the parts relevant to getting and setting values.

The naming of the attribute get and set methods in the Python bindings are carefully constructed to correspond to the ones returned here, to avoid construction of huge lookup tables. It makes the types instantly recognize newly added support, and it makes them easier to expand, at the cost of being less explicit about the correspondance between type and method.

Note

If the attribute type is determined at runtime (e.g. Union or Any) then the resolved type is used. When the type is not yet resolved the raw types of the attributes are returned (usually “token”)

Parameters

attribute_object – Attribute-like object that has an attribute type that can be decomposed

Returns

og.Type with the type information of the attribute_object

Raises

TypeError – If the attribute type or attribute type object is not supported

omni.graph.core.generate_ogn_from_node(node: omni.graph.core._omni_graph_core.Node)Dict[str, Any]

Return a .ogn dictionary that implements the node type information contained in the given node

omni.graph.core.get_all_graphs()List[omni.graph.core._omni_graph_core.Graph]

Returns a list of the top level graphs (non-orchestration) in OmniGraph.

omni.graph.core.get_all_graphs_and_subgraphs()List[omni.graph.core._omni_graph_core.Graph]

Returns a list of all graphs and subgraphs in OmniGraph.

omni.graph.core.get_attribute_configuration(attr: Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute, omni.graph.core._omni_graph_core.AttributeData])

Get the array configuration information from the attribute.

Attributes can be simple, tuples, or arrays of either. The information on what this is will be encoded in the attribute type name. This method decodes that type name to find out what type of attribute data the attribute will use.

The method also gives the right answers for both Attribute and AttributeData with some suitable AttributeError catches to special case on unimplemented methods.

Parameters

attr – Attribute whose configuration is being determined

Returns

str: Name of the full/resolved data type used by the attribute (e.g. “float[3][]”) str: Name of the simple data type used by the attribute (e.g. “float”) bool: True if the data type is a tuple or array (e.g. “float3” or “float[]”) bool: True if the data type is a matrix and should be flattened (e.g. “matrixd[3]” or “framed[4][]”)

Return type

Tuple of

Raises

TypeError – If the attribute type is not yet supported

omni.graph.core.get_compute_graph_contexts()List[omni.graph.core._omni_graph_core.GraphContext]

Returns a list of the compute graph contexts in OmniGraph.

omni.graph.core.get_current_graph()omni.graph.core._omni_graph_core.Graph

Returns the current graph.

omni.graph.core.get_global_container_graphs()List[omni.graph.core._omni_graph_core.Graph]

Returns a list of the global container graphs (renamed to orchestration graph) that house all other graphs. This method is deprecated. Use get_global_orchestration_graphs instead.

omni.graph.core.get_global_orchestration_graphs()List[omni.graph.core._omni_graph_core.Graph]

Returns a list of the global orchestration graphs that house all other graphs.

omni.graph.core.get_global_orchestration_graphs_in_pipeline_stage(pipeline_stage: omni.graph.core._omni_graph_core.GraphPipelineStage)List[omni.graph.core._omni_graph_core.Graph]

Returns a list of the global orchestration graphs that house all other graphs for a given pipeline stage. :param pipeline_stage: The pipeline stage in question :type pipeline_stage: omni.graph.core.GraphPipelineStage

omni.graph.core.get_graph_by_path(path: str)object

Finds the graph with the given path.

Parameters

path (str) – The path of the graph. For example “/World/PushGraph”

Returns

The omni.graph.core.Graph object of the matching graph, or None if it was not found.

omni.graph.core.get_graph_settings(graph: Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph])omni.graph.core._impl.utils.GraphSettings

Return the current settings for the graph. This is just a copy of the settings. Changing it will not affect the graph’s settings. To do that you must go through the graph ABI

omni.graph.core.get_graphs_in_pipeline_stage(pipeline_stage: omni.graph.core._omni_graph_core.GraphPipelineStage)List[omni.graph.core._omni_graph_core.Graph]

Returns a list of the non-orchestration graphs for a given pipeline stage (simulation, pre-render, post-render) :param pipeline_stage: The pipeline stage in question :type pipeline_stage: omni.graph.core.GraphPipelineStage

Returns

The list of graphs belonging to the pipeline stage

Return type

List[og.Graph]

omni.graph.core.get_node_by_path(arg0: str)object

Returns the node corresponding to a node path in OmniGraph, None if no matching node was found at that path.

omni.graph.core.get_node_categories_interface()omni.graph.core._omni_graph_core.INodeCategories
Returns

An INodeCategories object that can interface with the category data

omni.graph.core.get_node_type(node_type_name: str)omni.graph.core._omni_graph_core.NodeType

Returns the registered NodeType object of the given name.

Parameters

node_type_name (str) – Name of the registered NodeType to find and return

Returns

NodeType object registered with the given name, None if it is not registered

Return type

(omni.graph.core.NodeType)

omni.graph.core.get_port_type_namespace(port_type: omni.graph.core._omni_graph_core.AttributePortType)str

Returns a string representing the namespace attributes of the named port type reside in

omni.graph.core.get_registered_nodes()List[str]

Returns the list of names of node types currently registered

omni.graph.core.graph_iterator(root: Optional[omni.graph.core._omni_graph_core.Graph] = None)Tuple[omni.graph.core._omni_graph_core.Graph, omni.graph.core._omni_graph_core.Graph]

Generator function that provides the ability to walk through all graphs and their subgraphs in a manner similar to the os.walk function. The yield is the graph found at the current iteration step. It walks the graphs from the bottom up in a breadth-first way.

Parameters

root – Starting graph - walk all graphs if None

for graph in graph_iterator():
    print(f"Walking over graph at {graph.get_path_to_graph()}")
omni.graph.core.is_attribute_plain_data(attrib: Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Attribute, pxr.Usd.Attribute])bool

Is the given attribute is numeric or string data?

Parameters

attrib – The attribute in question

Returns

True if the given attribute is numeric or string data

omni.graph.core.is_global_graph_prim(prim_path: str)bool

Determines if the prim path passed in represents a prim that is backing a global graph

Parameters

prim_path (str) – The path to the prim in question

Returns

(bool) True if the prim path represents a prim that is backing a global graph, False otherwise

async omni.graph.core.load_example_file(example_file_name: str)

Load the contents of the USD example file onto the stage Loading will be effectively synchronous when called as “await load_example_file(X)”. In a testing environment we need to run one test at a time since there is no guarantee that tests can run concurrently, especially when loading files. This method encapsulates the logic necessary to load a test file using the omni.kit.asyncapi method and then wait for it to complete before returning.

Parameters

example_file_name – Name of the example file to load - if an absolute path use it as-is

Raises

ValueError – test file is not a valid USD file

omni.graph.core.register_autonode_type_extension(handler: omni.graph.core._impl.autonode.type_definitions.AutoNodeDefinitionGenerator, **kwargs)
omni.graph.core.register_node(name: object, version: int_)None

Deprecated method - use register_node_type instead.

omni.graph.core.register_node_type(name: object, version: int_)None

Registers a new python subnode type with OmniGraph. See compute graph documentation for details.

Parameters
  • name (str) – Name of the Python node type being registered

  • version (int) – Version number of the Python node type being registered

omni.graph.core.register_ogn_nodes(file_requesting_registration: str, import_path: str)List[Callable]

Scan the generated ogn/ subdirectory for files that look like nodes and import them to force registration

Also regenerates the tests/__init__.py file for automatic test registration.

Parameters
  • file_requesting_registration – Path to the file in the .ogn directory tree

  • import_path – Python import path of the file requesting the registration (e.g. omni.graph.core)

Returns

List of methods to deregister all of the node types (to save for extension shutdown)

omni.graph.core.register_post_load_file_format_upgrade_callback(callback: object)int

Registers a callback to be invoked when the file format version changes. Happens after the file has already been parsed and stage attached to. The callback takes 3 parameters: the old file format version, the new file format version, and the affected graph object.

Parameters

callback (Callable) – The callback function

Returns

A handle that could 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.

omni.graph.core.register_pre_load_file_format_upgrade_callback(callback: object)int

Registers a callback to be invoked when the file format version changes. Happens before the file has already been parsed and stage attached to. The callback takes 3 parameters: the old file format version, the new file format version, and a graph object (always invalid since the graph has not been created yet).

Parameters

callback (Callable) – The callback function

Returns

A handle that could 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.

omni.graph.core.register_python_node()None

Register the Python node type with OmniGraph.

omni.graph.core.release_interface(arg0: omni::graph::core::ComputeGraph)None
omni.graph.core.remove_attributes_if(node: Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed, List[Union[str, omni.graph.core._omni_graph_core.Node, pxr.Sdf.Path, pxr.Usd.Prim, pxr.Usd.Typed]]], attribute_filter_function: Optional[Callable[[omni.graph.core._omni_graph_core.Attribute], bool]] = None)int

Disconnects and removes the dynamic attributes on the given node which pass a given filter.

Parameters
  • node – The node to remove attributes from

  • attribute_filter_function – A function which returns True when given at prospective Attribute that should be removed. If None, all dynamic attributes will be removed.

Returns

The number of attributes removed.

omni.graph.core.resolve_base_coupled(attribute_specs: Sequence[Tuple[omni.graph.core._omni_graph_core.Attribute, int, int, omni.graph.core._omni_graph_core.AttributeRole]])None

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. For example if node ‘makeTuple2’ has two input attributes ‘a’ and ‘b’ and one output ‘c’ and we want to resolve ‘a’:float, ‘b’:float, ‘c’:float[2] (convertible base types, different tuple counts) we would use the input:

[
    (node.get_attribute("inputs:a"), None, None, None),
    (node.get_attribute("inputs:b"), None, None, None),
    (node.get_attribute("outputs:c"), None, 1, None)
]

Assuming a gets resolved first, the None will be set to the respective values for the resolved type (a). For this example, it will use defaults tuple_count=1, array_depth=0, role=NONE.

This function should only be called from on_connection_type_resolve.

Parameters
  • attribute_specs – list of (attribute, tuple_count, array_depth, role) of extended attributes to be resolved.

  • for tuple_count ('None') –

  • array_depth

  • role means 'use the resolved type'. (or) –

omni.graph.core.resolve_fully_coupled(attributes: Sequence[omni.graph.core._omni_graph_core.Attribute])None

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 we want the types of ‘a’ and ‘b’ to always match. This function will take under consideration the available conversions

This function should only be called from on_connection_type_resolve.

Parameters

attributes – list of extended attributes to be resolved

omni.graph.core.set_test_failure(has_failure: bool)None

Sets or clears a generic test failure.

Parameters

has_failure (bool) – If True then increment the test failure count, else clear it.

omni.graph.core.shutdown_compute_graph()None

Shuts down the compute graph.

omni.graph.core.sync_to_usd(attribute: omni.graph.core._omni_graph_core.Attribute, value: Any)

This is necessary to update USD at the moment. Updating flatcache and USD should be a feature that can be accessed at the low level for efficiency (e.g. in the IAttributeData interface).

omni.graph.core.temporary_setting(setting_name: str, setting_value: Any)

Generator to temporarily use a new setting value

with temporary_setting(“/persistent/omnigraph/allowGlobalImplicitGraph”, True):

do_something_that_needs_global_graph()

omni.graph.core.test_failure_count()int
Returns

The number of currently active test failures.

omni.graph.core.unregister_autonode_type_extension(handler: omni.graph.core._impl.autonode.type_definitions.AutoNodeDefinitionGenerator, **kwargs)
omni.graph.core.update(current_time: float, elapsed_time: float)None

Ticks the graph with the current time and elapsed time.

Parameters
  • current_time (float) – The current time

  • elapsed_time (float) – The elapsed time since the last tick

omni.graph.core.update_to_include_schema(new_file_format_version: Optional[Tuple[int, int]] = None)Dict[str, Any]

Update the current file to use the new schema. See OmniGraphSchemaMigrator.update() for details

This can run either before OmniGraph has attached to the stage (e.g. when reading in an old file) or when an explicit migration has been requested (e.g. when an old file exists and the user wants to migrate it). In both cases if any prim types have been migrated the useSchemaPrims setting will be forced to True so that subsequent OmniGraph additions use the schema types. (Mostly because this is easier than trying to track the state of whether a graph contains such prims already.)

Conversion of old scenes entails:
  • Changing any ComputeGraph or GlobalComputeGraph prims to be OmniGraph types

  • If a ComputeGraphSettings prim exists, migrating its attribute values to the OmniGraph prim

  • Changing any ComputeNode prims to be OmniGraphNode types

  • If any ComputeNode prims appear without a parent ComputeGraph then create a default graph and move them into it

Parameters

new_file_format_version – The file format version that should be used for the graph setting. If None then it will force the version immediately following the schema conversion (1, 3)

Returns

A dictionary of operations that were performed as part of the migration (key describes the operation, value is the objects to which it was applied)

Raises

og.OmniGraphError if any of the attempted changes failed - will attempt to restore graph to original state