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

Parameters
  • path (Attribute) – The destination attr

  • modify_usd (bool) – Whether to create USD.

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

Parameters
  • path (str) – The path to the prim

  • modify_usd (bool) – Whether to modify USD.

  • write (bool) – Whether this connection represents a bundle

Returns

(bool) True for success, False for fail

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

Returns the message associated with a deprecated attribute. Typically this message gives guidance as to what the user should do instead of using the deprecated attribute.

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.

Parameters
  • attribute (Attribute) – The destination attr of the connection to remove

  • modify_usd (bool) – Whether to modify USD.

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

Parameters
  • path (str) – The path to the prim

  • modify_usd (bool) – Whether to modify USD.

  • write (bool) – Whether this connection represents a bundle

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_deprecated(self: omni.graph.core._omni_graph_core.Attribute)bool

Returns whether the attribute is deprecated. Deprecated attributes should not be used as they will be removed in a future version.

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) – A function with one argument representing the attribute that changed.

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_default(self: omni.graph.core._omni_graph_core.Attribute, value: object, on_gpu: bool = False)bool

Sets the default value of the attribute’s data (value when not connected)

Parameters
  • value (Any) – New value of the default 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]

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

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.BucketId
property id
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, gpu_ptr_kinds: Optional[Dict[str, omni.graph.core._omni_graph_core.PtrToPtrKind]] = None)

——– 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, gpu_ptr_kind: omni.graph.core._omni_graph_core.PtrToPtrKind = PtrToPtrKind.NA)

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

class omni.graph.core.ComputeGraph
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.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._impl.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: Optional[Dict[str, Any]] = None)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) “evaluation_mode”: og.GraphEvaluationMode that tells you which evaluation mode this graph uses (default og.GraphEvaluationMode.GRAPH_EVALUATION_MODE_AUTOMATIC)

  • 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

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

property gpu_ptr_kind

Returns the location of pointers to GPU arrays

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, gpu_ptr_kind: omni.graph.core._omni_graph_core.PtrToPtrKind = PtrToPtrKind.NA)

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

Device on which the memory is located.

gpu_ptr_kind

Arrays of GPU pointers can either be on the GPU or the CPU, depending on where you want to reference them. If the shape is an array and device is cuda then this tells where ‘memory’ lives

is_array()bool

Returns True iff the data shape indicates that it is an arbitrary sized array of some kind

class omni.graph.core.Database(node: omni.graph.core._omni_graph_core.Node, context_helper: Optional[omni.graph.tools._impl.deprecate.DeprecatedClass.__call__.<locals>.wrapper] = 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 - 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.

INTERFACE = {}
PER_NODE_DATA = {}
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(ogn.MetadataKeys.UI_NAME)

To get the metadata from a specific attribute:

input_x_ui_name = db.get_metadata(ogn.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)

Deprecated function. Will perform a copy instead of moving

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

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?

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.DynamicAttributeAccess(context_id: Union[omni.graph.core._omni_graph_core.GraphContext, omni.graph.tools._impl.deprecate.DeprecatedClass.__call__.<locals>.wrapper], 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[Any] = 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[Any] = 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

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
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, name: str, path: str, evaluator: str, is_global_graph: bool, is_backed_by_usd: bool, backing_type: omni.graph.core._omni_graph_core.GraphBackingType, pipeline_stage: omni.graph.core._omni_graph_core.GraphPipelineStage, evaluation_mode: omni.graph.core._omni_graph_core.GraphEvaluationMode = GraphEvaluationMode.GRAPH_EVALUATION_MODE_AUTOMATIC)omni.graph.core._omni_graph_core.Node

Creates a graph that is wrapped by a node in the current graph.

Parameters
  • arg0 (str) – The name of the node

  • arg1 (str) – The path to the graph

  • arg2 (str) – The name of the evaluator to use for the graph

  • arg3 (bool) – Whether this is a global graph

  • arg4 (bool) – Whether the constructs are to be backed by USD

  • arg5 (omni.graph.core.GraphBackingType) – The kind of cache backing this graph

  • arg6 (omni.graph.core.GraphPipelineStage) – What stage in the pipeline the global graph is at (simulation, pre-render, post-render)

  • arg7 (omni.graph.core.GraphEvaluationMode) – What mode to use when evaluating the graph

Returns

Node wrapping the graph that was created

Return type

(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
  • name (str) – The name of the variable

  • type (omni.graph.core.Type) – The type of the variable to create.

Returns

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

Return type

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

property evaluation_mode

The evaluation mode sets how the graph will be evaluated.

GRAPH_EVALUATION_MODE_AUTOMATIC - Evaluate the graph in Standalone mode when there are no relationships to it, otherwise it will be evaluated in Instanced mode.

GRAPH_EVALUATION_MODE_STANDALONE - Evaluates the graph with the graph Prim as the graph target, and ignore Prims with relationships to the graph Prim. Use this mode when constructing self-contained graphs that evaluate independently.

GRAPH_EVALUATION_MODE_INSTANCED - Evaluates only when the graph there are relationships from OmniGraphAPI interfaces. Each Prim with a relationship to the graph Prim will cause an evaluation, with the Graph Target set to path of Prim with the OmniGraphAPI interface. Use this mode when the graph represents as an asset or template that can be applied to multiple Prims.

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_evaluator_name(self: omni.graph.core._omni_graph_core.Graph)str

Returns the name of the graph evaluator (dirty_push, push, pull, execution, execution_pull)

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

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

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

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
  • attribute (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
  • attribute (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
  • 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

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

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
  • attribute (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
  • 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

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

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

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
  • attribute (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
  • 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

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

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

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

attribute (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
  • 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

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

attribute (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
  • 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

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

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

attribute (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
  • 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

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

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

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

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

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

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

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

Return type

(numpy.array[int])

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

Get the bundle object as read-write.

Parameters

arg0 (str) – the 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:

    attribute (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_graph_target(self: omni.graph.core._omni_graph_core.GraphContext)str

Get the Prim path of the graph target.

The graph target is defined as the parent Prim of the compute graph, except during instancing - where OmniGraph executes a graph once for each Prim. In the case of instancing, the graph target will change at each execution to be the path of the instance. If this is called outside of graph execution, the path of the graph Prim is returned, or an empty token if the graph does not have a Prim associated with it.

Returns

(str) The prim path of the current graph target.

get_input_bundle(*args, **kwargs)

Overloaded function.

  1. get_input_bundle(self: omni.graph.core._omni_graph_core.GraphContext, path: str) -> omni::graph::core::Py_Bundle

    Get the bundle object as read only.

    Args:

    arg0 (str): the path to the bundle

  2. get_input_bundle(self: omni.graph.core._omni_graph_core.GraphContext, node: omni.graph.core._omni_graph_core.Node, attribute_name: str) -> omni::graph::core::Py_Bundle

    Get a bundle object that is an input attribute.

    Args:

    node (omni.graph.core.Node): the node on which the bundle can be found attribute_name (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(*args, **kwargs)

Overloaded function.

  1. get_output_bundle(self: omni.graph.core._omni_graph_core.GraphContext, path: str) -> omni::graph::core::Py_Bundle

    Get a bundle object that is an output attribute.

    Args:

    arg0 (str): the path to the bundle

  2. get_output_bundle(self: omni.graph.core._omni_graph_core.GraphContext, node: omni.graph.core._omni_graph_core.Node, attribute_name: str) -> omni::graph::core::Py_Bundle

    Get a bundle object that is an output attribute.

    Args:

    node (omni.graph.core.Node): the node on which the bundle can be found attribute_name (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: carb::flatcache::BucketId)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'
PrimExposureType_t

alias of Union[str, omni.graph.core._impl.graph_controller.GraphController.PrimExposureType]

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(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, var_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

  • var_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_t, 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

classmethod exposed_attribute_name(exposure_type: PrimExposureType_t)str

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

classmethod get_variable_default_value(variable_id: Union[omni.graph.core._omni_graph_core.IVariable, Tuple[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph], str]])

Gets the default value of the given variable

Parameters

variable_id – The variable whose value is to be set

Returns

The default value of the variable.

Raises

OmniGraphError – If the variable is not valid or does not have valid usd backing.

classmethod node_type_to_expose(exposure_type: PrimExposureType_t)str

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

classmethod set_variable_default_value(variable_id: Union[omni.graph.core._omni_graph_core.IVariable, Tuple[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph], str]], value)

Sets the default value of a variable object.

Parameters
  • variable_id – The variable whose value is to be set

  • value – The value to set

Raises
  • OmniGraphError – If the variable is not valid, does not have valid usd backing, or value

  • is not a compatible type

class omni.graph.core.GraphEvaluationMode

Members:

GRAPH_EVALUATION_MODE_AUTOMATIC

GRAPH_EVALUATION_MODE_STANDALONE

GRAPH_EVALUATION_MODE_INSTANCED

GRAPH_EVALUATION_MODE_AUTOMATIC = GraphEvaluationMode.GRAPH_EVALUATION_MODE_AUTOMATIC
GRAPH_EVALUATION_MODE_INSTANCED = GraphEvaluationMode.GRAPH_EVALUATION_MODE_INSTANCED
GRAPH_EVALUATION_MODE_STANDALONE = GraphEvaluationMode.GRAPH_EVALUATION_MODE_STANDALONE
property name

handle) -> str

Type

(self

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) – Name of the node type to check

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, evaluation_mode: str = GraphEvaluationMode.GRAPH_EVALUATION_MODE_STANDALONE)

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

evaluation_mode: str = GraphEvaluationMode.GRAPH_EVALUATION_MODE_STANDALONE
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
class omni.graph.core.IBundle2

Provide read write access to recursive bundles.

clear_contents(self: omni.graph.core._omni_graph_core.IBundle2, bundle_metadata: bool = False, attributes: bool = True, child_bundles: bool = True)int

“Removes all attributes and child bundles from this bundle, but keeps the bundle itself.”

Args:

bundle_metadata (bool): Clears bundle metadata in this bundle. attributes (bool): Clears attributes in this bundle. child_bundles (bool): Clears child bundles in this bundle.

Returns:

True if successfully cleared.

copy_attribute(*args, **kwargs)

Overloaded function.

  1. copy_attribute(self: omni.graph.core._omni_graph_core.IBundle2, attribute: omni::graph::core::Py_AttributeData, overwrite: bool = True) -> omni::graph::core::Py_AttributeData

Create new attribute by copying existing one, including its data.

Created attribute is owned by this bundle.

Args:

attribute (attribute): Attribute whose data type is to be copied. overwrite (bool): Overwrite existing attribute in this bundle.

Returns:

Copied attribute.

  1. copy_attribute(self: omni.graph.core._omni_graph_core.IBundle2, name: str, attribute: omni::graph::core::Py_AttributeData, overwrite: bool = True) -> omni::graph::core::Py_AttributeData

Create new attribute by copying existing one, including its data.

Created attribute is owned by this bundle.

Args:

name (string): The new name for copied attribute. attribute (attribute): Attribute whose data type is to be copied. overwrite (bool): Overwrite existing attribute in this bundle.

Returns:

Copied attribute.

copy_attributes(*args, **kwargs)

Overloaded function.

  1. copy_attributes(self: omni.graph.core._omni_graph_core.IBundle2, attributes: List[omni::graph::core::Py_AttributeData], overwrite: bool = True) -> List[omni::graph::core::Py_AttributeData]

    Create new attributes by copying existing ones, including their data.

    Names of new attributes are taken from source attributes. Created attributes are owned by this bundle.

    Args:

    attributes (list of attribute): Attributes whose data type is to be copied. overwrite (bool): Overwrite existing attributes in this bundle.

    Returns:

    A list of copied attributes.

  2. copy_attributes(self: omni.graph.core._omni_graph_core.IBundle2, names: List[str], attributes: List[omni::graph::core::Py_AttributeData], overwrite: bool = True) -> List[omni::graph::core::Py_AttributeData]

Create new attributes by copying existing ones, including their data, with possibility of giving them new names.

Created attributes are owned by this bundle.

Args:

names (array of string): Names for the new attributes. attributes (array of attribute): Attributes whose data type is to be copied. overwrite (bool): Overwrite existing attributes in this bundle.

Returns:

A list of copied attributes.

copy_bundle(self: omni.graph.core._omni_graph_core.IBundle2, source_bundle: omni.graph.core._omni_graph_core.IConstBundle2, overwrite: bool = True)None

Copy bundle data and metadata from the source bundle to this bundle.

Args:

source_bundle (bundle): Bundle whose data is to be copied. overwrite (bool): Overwrite existing content of the bundle.

copy_child_bundle(self: omni.graph.core._omni_graph_core.IBundle2, name: str, bundle: omni.graph.core._omni_graph_core.IConstBundle2)omni.graph.core._omni_graph_core.IBundle2

Create new child bundle by copying existing one, with possibility of giving child a new name.

Created bundle is owned by this bundle.

Args:

name (string): Name of new child. bundle (bundle): Bundle whose data is to be copied.

Returns:

Newly copied bundle.

copy_child_bundles(self: omni.graph.core._omni_graph_core.IBundle2, names: List[str], bundles: List[omni.graph.core._omni_graph_core.IConstBundle2])List[omni.graph.core._omni_graph_core.IBundle2]

Create new child bundles by copying existing ones, with possibility of giving children new names.

Created bundles are owned by this bundle.

Args:

names (array of string): Names of new children. bundles (array of bundles): Bundles whose data is to be copied.

Returns:

Newly copied bundles.

create_attribute(self: omni.graph.core._omni_graph_core.IBundle2, name: str, type: omni::graph::core::Py_Type, element_count: int = 0)omni::graph::core::Py_AttributeData

Creates attribute based on provided name and type.

Created attribute is owned by this bundle.

Args:

name (string): Name of the attribute. type (type): Type of the attribute. element_count (int): Number of elements in the array.

Returns:

Newly created attribute.

create_attribute_like(self: omni.graph.core._omni_graph_core.IBundle2, pattern_attribute: omni::graph::core::Py_AttributeData)omni::graph::core::Py_AttributeData

Use input attribute as pattern to create attribute in this bundle.

The name and type are taken from pattern attribute, data is not copied. Created attribute is owned by this bundle.

Args:

pattern_attribute (attribute): Attribute whose name and type is to be used to create new attribute.

Returns:

Newly created attribute.

create_attribute_metadata(*args, **kwargs)

Overloaded function.

  1. create_attribute_metadata(self: omni.graph.core._omni_graph_core.IBundle2, attribute: str, field_names: List[str], field_types: List[omni::graph::core::Py_Type]) -> List[omni::graph::core::Py_AttributeData]

Create attribute metadata fields.

Args:

attribute (string): Name of the attribute. field_names (array of string): Names of new metadata field. field_types (array of type): Types of new metadata field. element_count (int): Number of elements in the arrray.

Returns:

Newarly created metadata field.

  1. create_attribute_metadata(self: omni.graph.core._omni_graph_core.IBundle2, attribute: str, field_name: str, field_type: omni::graph::core::Py_Type, element_count: int = 0) -> omni::graph::core::Py_AttributeData

Create attribute metadata field.

Args:

attribute (string): Name of the attribute. field_name (string): Name of new metadata field. field_type (type): Type of new metadata field.

Returns:

Newarly created metadata field.

create_attributes(self: omni.graph.core._omni_graph_core.IBundle2, names: List[str], types: List[omni::graph::core::Py_Type])List[omni::graph::core::Py_AttributeData]

Creates attributes based on provided names and types.

Created attributes are owned by this bundle.

Args:

names (array of string): Names of the attributes. types (array of type): Types of the attributes.

Returns:

A list of created attributes.

create_attributes_like(self: omni.graph.core._omni_graph_core.IBundle2, pattern_attributes: List[omni::graph::core::Py_AttributeData])List[omni::graph::core::Py_AttributeData]

Use input attributes as pattern to create attributes in this bundle.

Names and types for new attributes are taken from pattern attributes, data is not copied. Created attributes are owned by this bundle.

Args:

pattern_attributes (array of attribute): Attributes whose name and type is to be used to create new attributes.

Returns:

A list of newly created attributes.

create_bundle_metadata(*args, **kwargs)

Overloaded function.

  1. create_bundle_metadata(self: omni.graph.core._omni_graph_core.IBundle2, field_names: List[str], field_types: List[omni::graph::core::Py_Type]) -> List[omni::graph::core::Py_AttributeData]

Creates bundle metadata fields based on provided names and types.

Created fields are owned by this bundle.

Args:

field_names (array of string): Names of the fields. field_types (array of type): Types of the fields. element_count (int): Number of elements in the arrray.

Returns:

A list of created fields.

  1. create_bundle_metadata(self: omni.graph.core._omni_graph_core.IBundle2, field_name: str, field_type: omni::graph::core::Py_Type, element_count: int = 0) -> omni::graph::core::Py_AttributeData

Creates bundle metadata field based on provided name and type.

Created field are owned by this bundle.

Args:

field_name (string): Name of the field. field_type (type): Type of the field.

Returns:

Created field.

create_child_bundle(self: omni.graph.core._omni_graph_core.IBundle2, path: str)omni.graph.core._omni_graph_core.IBundle2

Creates immediate child bundle under specified path in this bundle.

Created bundle is owned by this bundle. This method does not work recursively. Only immediate child can be created.

Args:

path (string): New child path in this bundle.

Returns:

Created child bundle.

create_child_bundles(self: omni.graph.core._omni_graph_core.IBundle2, paths: List[str])List[omni.graph.core._omni_graph_core.IBundle2]

Creates immediate child bundles under specified paths in this bundle.

Created bundles are owned by this bundle. This method does not work recursively. Only immediate children can be created.

Args:

paths (array of string): New children paths in this bundle.

Returns:

A list of created child bundles.

get_attribute_by_name(self: omni.graph.core._omni_graph_core.IBundle2, name: str)omni::graph::core::Py_AttributeData

Searches for attribute in this bundle by using attribute name.

Args:

name (string): Attribute name to search for.

Returns:

An attribute. If attribute is not found then invalid attribute is returned.

get_attribute_metadata_by_name(*args, **kwargs)

Overloaded function.

  1. get_attribute_metadata_by_name(self: omni.graph.core._omni_graph_core.IBundle2, attribute: str, field_names: List[str]) -> List[omni::graph::core::Py_AttributeData]

Search for metadata fields for the attribute by using field names.

Args:

attribute (string): Name of the attribute. field_names (array of string): Attribute metadata fields to be searched for.

Returns:

Array of metadata fields in the attribute.

  1. get_attribute_metadata_by_name(self: omni.graph.core._omni_graph_core.IBundle2, attribute: str, field_name: str) -> omni::graph::core::Py_AttributeData

Search for metadata field for the attribute by using field name.

Args:

attribute (string): Name of the attribute. field_name (string): Attribute metadata field to be searched for.

Returns:

Metadata fields in the attribute.

get_attributes(self: omni.graph.core._omni_graph_core.IBundle2)List[omni::graph::core::Py_AttributeData]

Searches for attributes in this bundle by using attribute names.

Args:

names (array of string): Attribute names to search for.

Returns:

A list of found attributes.

get_attributes_by_name(self: omni.graph.core._omni_graph_core.IBundle2, names: List[str])List[omni::graph::core::Py_AttributeData]

Searches for attributes in this bundle by using attribute names.

Args:

names (array of string): Attribute names to search for.

Returns:

A list of found attributes.

get_bundle_metadata_by_name(*args, **kwargs)

Overloaded function.

  1. get_bundle_metadata_by_name(self: omni.graph.core._omni_graph_core.IBundle2, field_names: List[str]) -> List[omni::graph::core::Py_AttributeData]

Search for field handles in this bundle by using field names.

Args:

field_names (array of string): Bundle metadata fields to be searched for.

Returns:

Metadata fields in this bundle.

  1. get_bundle_metadata_by_name(self: omni.graph.core._omni_graph_core.IBundle2, field_name: str) -> omni::graph::core::Py_AttributeData

Search for field handle in this bundle by using field name.

Args:

field_name (string): Bundle metadata fields to be searched for.

Returns:

Metadata field in this bundle.

get_child_bundle(self: omni.graph.core._omni_graph_core.IBundle2, index: int)omni.graph.core._omni_graph_core.IBundle2

Get the child bundle by index.

Args:

index (int): Child bundle index in range [0, child_bundle_count).

Returns:

Child bundle under the index. If bundle index is out of range, then invalid bundle is returned.

get_child_bundle_by_name(self: omni.graph.core._omni_graph_core.IBundle2, name: str)omni.graph.core._omni_graph_core.IBundle2

Lookup for child under specified name.

Args:

path (string): Name to child bundle in this bundle.

Returns:

Child bundle in this bundle. If child does not exist under the path, then invalid bundle is returned.

get_child_bundles(self: omni.graph.core._omni_graph_core.IBundle2)List[omni.graph.core._omni_graph_core.IBundle2]

Get all child bundle handles in this bundle.

Returns:

A list of all child bundles in this bundle.

get_child_bundles_by_name(self: omni.graph.core._omni_graph_core.IBundle2, names: List[str])List[omni.graph.core._omni_graph_core.IBundle2]

Lookup for children under specified names.

Args:

names (array of string): Names to child bundles in this bundle.

Returns:

A list of found child bundles in this bundle.

get_metadata_storage(self: omni.graph.core._omni_graph_core.IBundle2)omni.graph.core._omni_graph_core.IBundle2

Get access to metadata storage that contains all metadata information

get_parent_bundle(self: omni.graph.core._omni_graph_core.IBundle2)omni.graph.core._omni_graph_core.IBundle2
Returns

The parent of this bundle, or invalid bundle if there is no parent.

Overloaded function.

  1. link_attribute(self: omni.graph.core._omni_graph_core.IBundle2, target_attribute: omni::graph::core::Py_AttributeData) -> omni::graph::core::Py_AttributeData

Adds an attribute to this bundle as link with names taken from target attribute.

Added attribute is a link to other attribute that is part of another bundle. The link is owned by this bundle, but target of the link is not. Removing link from this bundle does not destroy the data link points to.

Args:

target_attribute (attribute): Attribute whose data is to be added.

Returns:

Attribute that is a link.

  1. link_attribute(self: omni.graph.core._omni_graph_core.IBundle2, link_name: str, target_attribute: omni::graph::core::Py_AttributeData) -> omni::graph::core::Py_AttributeData

Adds an attribute to this bundle as link with custom name.

Added attribute is a link to other attribute that is part of another bundle. The link is owned by this bundle, but target of the link is not. Removing link from this bundle does not destroy the data link points to.

Args:

link_name (string): Name for new link. target_attribute (attribute): Attribute whose data is to be added.

Returns:

Attribute that is a link.

Overloaded function.

  1. link_attributes(self: omni.graph.core._omni_graph_core.IBundle2, target_attributes: List[omni::graph::core::Py_AttributeData]) -> List[omni::graph::core::Py_AttributeData]

Adds a set of attributes to this bundle as links with names taken from target attributes.

Added attributes are links to other attributes that are part of another bundle. The links are owned by this bundle, but targets of the links are not. Removing links from this bundle does not destroy the data links point to.

Args:

target_attributes (array of attribute): Attributes whose data is to be added.

Returns:

A list of attributes that are links.

  1. link_attributes(self: omni.graph.core._omni_graph_core.IBundle2, link_names: List[str], target_attributes: List[omni::graph::core::Py_AttributeData]) -> List[omni::graph::core::Py_AttributeData]

Adds a set of attributes to this bundle as links with custom names.

Added attributes are links to other attributes that are part of another bundle. The links are owned by this bundle, but targets of the links are not. Removing links from this bundle does not destroy the data links point to.

Args:

link_names (array of string): target_attributes (array of attribute): Attributes whose data is to be added.

Returns:

A list of attributes that are links.

Overloaded function.

  1. link_child_bundle(self: omni.graph.core._omni_graph_core.IBundle2, name: str, bundle: omni.graph.core._omni_graph_core.IConstBundle2) -> omni.graph.core._omni_graph_core.IBundle2

Link a bundle as child in current bundle, under given name.

Args:

name (string): The name under which the child bundle should be linked bundle (bundle): The bundle to link

Returns:

The created bundles

  1. link_child_bundle(self: omni.graph.core._omni_graph_core.IBundle2, bundle: omni.graph.core._omni_graph_core.IConstBundle2) -> omni.graph.core._omni_graph_core.IBundle2

Link a bundle as child in current bundle.

Args:

bundle (bundle): The bundle to link

Returns:

The created bundle

Overloaded function.

  1. link_child_bundles(self: omni.graph.core._omni_graph_core.IBundle2, names: List[str], bundles: List[omni.graph.core._omni_graph_core.IConstBundle2]) -> List[omni.graph.core._omni_graph_core.IBundle2]

Link a set of bundles as child in current bundle, under given names.

Args:

names (array of string): The names under which the child bundles should be linked bundles (array of bundles): The bundles to link

Returns:

The list of created bundles

  1. link_child_bundles(self: omni.graph.core._omni_graph_core.IBundle2, bundles: List[omni.graph.core._omni_graph_core.IConstBundle2]) -> List[omni.graph.core._omni_graph_core.IBundle2]

Link a set of bundles as child in current bundle.

Args:

bundles (array of bundles): The bundles to link

Returns:

The list of created bundles

remove_all_attributes(self: omni.graph.core._omni_graph_core.IBundle2)int

Remove all attributes from this bundle.

Returns:

Number of attributes successfully removed.

remove_all_child_bundles(self: omni.graph.core._omni_graph_core.IBundle2)int

Remove all child bundles from this bundle.

Only empty bundle can be removed.

Returns:

Number of child bundles successfully removed.

remove_attribute(self: omni.graph.core._omni_graph_core.IBundle2, attribute: omni::graph::core::Py_AttributeData)int

Looks up the attribute and if it is part of this bundle then remove it.

Attribute handle that is not part of this bundle is ignored.

Args:

attribute (attribute): Attribute whose data is to be removed.

Returns:

Number of attributes successfully removed.

remove_attribute_metadata(*args, **kwargs)

Overloaded function.

  1. remove_attribute_metadata(self: omni.graph.core._omni_graph_core.IBundle2, attribute: str, field_names: List[str]) -> int

Remove attribute metadata fields.

Args:

attribute (string): Name of the attribute. field_names (array of string): Names of the fields to be removed.

Returns:

Number of fields successfully removed.

  1. remove_attribute_metadata(self: omni.graph.core._omni_graph_core.IBundle2, attribute: str, field_name: str) -> int

Remove attribute metadata field.

Args:

attribute (string): Name of the attribute. field_name (string): Name of the field to be removed.

Returns:

True if successfully removed.

remove_attributes(self: omni.graph.core._omni_graph_core.IBundle2, attributes: List[omni::graph::core::Py_AttributeData])int

Looks up the attributes and if they are part of this bundle then remove them.

Attribute handles that are not part of this bundle are ignored.

Args:

attributes (array of attribute): Attributes whose data is to be removed.

remove_attributes_by_name(self: omni.graph.core._omni_graph_core.IBundle2, names: List[str])int

Looks up the attributes by names and remove their data and metadata.

Args:

names (array of string): Names of the attributes whose data is to be removed.

remove_bundle_metadata(*args, **kwargs)

Overloaded function.

  1. remove_bundle_metadata(self: omni.graph.core._omni_graph_core.IBundle2, field_names: List[str]) -> int

Looks up bundle metadata fields and if they are part of this bundle metadata then remove them.

Fields that are not part of this bundle are ignored.

Args:

field_names (array of string): Names of the fields whose data is to be removed.

Returns:

Number of fields successfully removed.

  1. remove_bundle_metadata(self: omni.graph.core._omni_graph_core.IBundle2, field_name: str) -> int

Looks up bundle metadata field and if it is part of this bundle metadata then remove it.

Field that is not part of this bundle is ignored.

Args:

field_name (string): Name of the field whose data is to be removed.

Returns:

True if field is successfully removed.

remove_child_bundle(self: omni.graph.core._omni_graph_core.IBundle2, bundle: omni.graph.core._omni_graph_core.IConstBundle2)int

Looks up the bundle and if it is child of the bundle then remove it.

Bundle handle that is not child of this bundle is ignored. Only empty bundle can be removed.

Args:

bundle: bundle to be removed.

Returns:

True if child bundle was successfully removed, False otherwise.

remove_child_bundles(self: omni.graph.core._omni_graph_core.IBundle2, bundles: List[omni.graph.core._omni_graph_core.IConstBundle2])int

Looks up the bundles and if they are children of the bundle then remove them.

Bundle handles that are not children of this bundle are ignored. Only empty bundles can be removed.

Args:

bundles: Bundles to be removed.

Returns:

Number of child bundles successfully removed.

remove_child_bundles_by_name(self: omni.graph.core._omni_graph_core.IBundle2, names: List[str])int

Looks up child bundles by name and remove their data and metadata.

Args:

names (array of string): Names of the child bundles to be removed.

class omni.graph.core.IBundleFactory
static create()omni.graph.core._omni_graph_core.IBundleFactory

Create instance of bundle factory.

create_bundle(self: omni.graph.core._omni_graph_core.IBundleFactory, context: omni::graph::core::Py_GraphContext, path: str)omni.graph.core._omni_graph_core.IBundle2

Create bundle at given path.

Args:

context: The context where bundles are created. path: Location for new bundle.

Returns:

Bundle instance.

create_bundles(self: omni.graph.core._omni_graph_core.IBundleFactory, context: omni::graph::core::Py_GraphContext, paths: List[str])List[omni.graph.core._omni_graph_core.IBundle2]

Create bundles at given paths.

Args:

context: The context where bundles are created. paths: Locations for new bundles.

Returns:

A list of bundle instances.

get_bundle(self: omni.graph.core._omni_graph_core.IBundleFactory, context: omni::graph::core::Py_GraphContext, bundle: omni::graph::core::Py_Bundle)object

Acquire bundle instance from Py_Bundle.

Args:

context: The context where bundle is located. bundle: Input Py_Bundle instance.

Returns:

Bundle instances.

get_bundles(self: omni.graph.core._omni_graph_core.IBundleFactory, context: omni::graph::core::Py_GraphContext, bundles: List[omni::graph::core::Py_Bundle])List[object]

Acquire bundle instances from Py_Bundles.

Args:

context: The context where bundles are located. bundles: A list of Py_Bundles.

Returns:

A list of bundle instances.

class omni.graph.core.IConstBundle2

Provide read only access to recursive bundles.

get_attribute_by_name(self: omni.graph.core._omni_graph_core.IConstBundle2, name: str)omni::graph::core::Py_AttributeData

Searches for attribute in this bundle by using attribute name.

Args:

name (string): Attribute name to search for.

Returns:

An attribute. If attribute is not found then invalid attribute is returned.

get_attribute_count(self: omni.graph.core._omni_graph_core.IConstBundle2)int
Retruns:

Number of attributes in this bundle.

get_attribute_metadata_by_name(*args, **kwargs)

Overloaded function.

  1. get_attribute_metadata_by_name(self: omni.graph.core._omni_graph_core.IConstBundle2, attribute: str, field_names: List[str]) -> List[omni::graph::core::Py_AttributeData]

Search for metadata fields for the attribute by using field names.

Args:

attribute (string): Name of the attribute. field_names (array of string): Attribute metadata fields to be searched for.

Returns:

Array of metadata fields in the attribute.

  1. get_attribute_metadata_by_name(self: omni.graph.core._omni_graph_core.IConstBundle2, attribute: str, field_name: str) -> omni::graph::core::Py_AttributeData

Search for metadata field for the attribute by using field name.

Args:

attribute (string): Name of the attribute. field_name (string): Attribute metadata field to be searched for.

Returns:

Metadata fields in the attribute.

get_attribute_metadata_count(self: omni.graph.core._omni_graph_core.IConstBundle2, attribute: str)int
Returns

Number of metadata fields in the attribute.

get_attribute_metadata_names(self: omni.graph.core._omni_graph_core.IConstBundle2, attribute: str)List[str]

Get names of all metadata fields in the attribute.

Args:

attribute (string): Name of the attribute.

Returns:

Array of names in the attribute.

get_attribute_metadata_types(self: omni.graph.core._omni_graph_core.IConstBundle2, attribute: str)List[omni::graph::core::Py_Type]

Get types of all metadata fields in the attribute.

Args:

attribute (string): Name of the attribute.

Returns:

Array of types in the attribute.

get_attribute_names(self: omni.graph.core._omni_graph_core.IConstBundle2)List[str]

Get the names of all attributes in this bundle.

Returns:

A list of the names.

get_attribute_types(self: omni.graph.core._omni_graph_core.IConstBundle2)List[omni::graph::core::Py_Type]

Get the types of all attributes in this bundle.

Returns:

A list of the types.

get_attributes(self: omni.graph.core._omni_graph_core.IConstBundle2)List[omni::graph::core::Py_AttributeData]

Get all attributes in this bundle.

Returns:

A list of all attributes in this bundle.

get_attributes_by_name(self: omni.graph.core._omni_graph_core.IConstBundle2, names: List[str])List[omni::graph::core::Py_AttributeData]

Searches for attributes in this bundle by using attribute names.

Args:

names (array of string): Attribute names to search for.

Returns:

A list of found attributes.

get_bundle_metadata_by_name(*args, **kwargs)

Overloaded function.

  1. get_bundle_metadata_by_name(self: omni.graph.core._omni_graph_core.IConstBundle2, field_names: List[str]) -> List[omni::graph::core::Py_AttributeData]

Search for field handles in this bundle by using field names.

Args:

field_names (array of string): Bundle metadata fields to be searched for.

Returns:

Metadata fields in this bundle.

  1. get_bundle_metadata_by_name(self: omni.graph.core._omni_graph_core.IConstBundle2, field_name: str) -> omni::graph::core::Py_AttributeData

Search for field handle in this bundle by using field name.

Args:

field_name (string): Bundle metadata fields to be searched for.

Returns:

Metadata field in this bundle.

get_bundle_metadata_count(self: omni.graph.core._omni_graph_core.IConstBundle2)int
Returns

Number of metadata fields in this bundle.

get_bundle_metadata_names(self: omni.graph.core._omni_graph_core.IConstBundle2)List[str]

Get the names of all metadata fields in this bundle.

Returns:

Array of names in this bundle.

get_bundle_metadata_types(self: omni.graph.core._omni_graph_core.IConstBundle2)List[omni::graph::core::Py_Type]

Get the types of all metadata fields in this bundle.

Returns:

Array of types in this bundle.

get_child_bundle(self: omni.graph.core._omni_graph_core.IConstBundle2, index: int)omni.graph.core._omni_graph_core.IConstBundle2

Get the child bundle by index.

Args:

index (int): Child bundle index in range [0, child_bundle_count).

Returns:

Child bundle under the index. If bundle index is out of range, then invalid bundle is returned.

get_child_bundle_by_name(self: omni.graph.core._omni_graph_core.IConstBundle2, path: str)omni.graph.core._omni_graph_core.IConstBundle2

Lookup for child under specified path.

Args:

path (string): Path to child bundle in this bundle.

Returns:

Child bundle in this bundle. If child does not exist under the path, then invalid bundle is returned.

get_child_bundle_count(self: omni.graph.core._omni_graph_core.IConstBundle2)int
Returns

Number of child bundles in this bundle.

get_child_bundles(self: omni.graph.core._omni_graph_core.IConstBundle2)List[omni.graph.core._omni_graph_core.IConstBundle2]

Get all child bundle handles in this bundle.

Returns:

A list of all child bundles in this bundle.

get_child_bundles_by_name(self: omni.graph.core._omni_graph_core.IConstBundle2, names: List[str])List[omni.graph.core._omni_graph_core.IConstBundle2]

Lookup for children under specified names.

Args:

names (array of string): Names to child bundles in this bundle.

Returns:

A list of found child bundles in this bundle.

get_context(self: omni.graph.core._omni_graph_core.IConstBundle2)omni::graph::core::Py_GraphContext
Returns

The context of this bundle.

get_metadata_storage(self: omni.graph.core._omni_graph_core.IConstBundle2)omni.graph.core._omni_graph_core.IConstBundle2

Get access to metadata storage that contains all metadata information

get_name(self: omni.graph.core._omni_graph_core.IConstBundle2)str
Returns

The name of this bundle.

get_parent_bundle(self: omni.graph.core._omni_graph_core.IConstBundle2)omni.graph.core._omni_graph_core.IConstBundle2
Returns

The parent of this bundle, or invalid bundle if there is no parent.

get_path(self: omni.graph.core._omni_graph_core.IConstBundle2)str
Returns

The path to this bundle.

property valid
class omni.graph.core.INodeCategories
property category_count
define_category(self: omni.graph.core._omni_graph_core.INodeCategories, category_name: str, category_description: 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.

Parameters

node_id (Union[str, Node]) – The node, or path to the node, whose categories are to be found

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.

Parameters

node_type_id (Union[str, NodeType]) – The node type, or name of the node type, whose categories are to be found

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, category_name: 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, data_type: 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, inspector: 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, data_type: omni.graph.core._omni_graph_core.eAccessLocation, new_access_type: 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
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.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

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

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

Parameters

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

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

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

Parameters

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

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

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

Parameters

name (str) – The name of the attribute

Returns

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

Return type

(omni.graph.core.Attribute)

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

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

Parameters

name (str) – The name of the attribute

Returns

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

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

Returns the list of attributes on this node.

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

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

Returns

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

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

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

Returns

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

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

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

Parameters

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

Returns

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

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

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

get_event_stream(self: omni.graph.core._omni_graph_core.Node)carb.events._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. [DEPRECATED]

Parameters

arg0 (Function) – The callback function

Returns

A handle that could be used for deregistration.

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

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

Parameters

arg0 (str) – Name of the attribute.

Returns

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

Return type

(bool)

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

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

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

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

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

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

Parameters

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

Returns

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

resolve_partially_coupled_attributes(self: omni.graph.core._omni_graph_core.Node, attributesArray: List[omni.graph.core._omni_graph_core.Attribute], tuplesArray: List[int], arraySizesArray: List[int], rolesArray: List[carb::flatcache::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) – Whether the input is required or not

  • 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) – Whether the output is required or not

  • arg2 (ExtendedAttributeType) – The kind of extended attribute this is e.g. omni.graph.core.ExtendedAttributeType.EXTENDED_ATTR_TYPE_UNION

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) – Whether the state is required or not

  • arg2 (ExtendedAttributeType) – The kind of extended attribute this is e.g. omni.graph.core.ExtendedAttributeType.EXTENDED_ATTR_TYPE_UNION

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) – Whether the input is required or not

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) – Whether the output is required or not

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) – Whether the state is required or not

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

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

Variables_t
  • An omni.graph.core.IVariable object

  • A 2-tuple consisting of a omni.graph.core.GraphSpec_t and a string, where the string is the name of the variable

  • 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 a recognized type 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.

classmethod variable(variable_id: Union[omni.graph.core._omni_graph_core.IVariable, Tuple[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph], str], List[Union[omni.graph.core._omni_graph_core.IVariable, Tuple[Union[str, pxr.Sdf.Path, omni.graph.core._omni_graph_core.Graph], str]]]])Union[omni.graph.core._omni_graph_core.IVariable, List[omni.graph.core._omni_graph_core.IVariable]]

Returns the variables(s) corresponding to the variable description

Parameters

variable_id – Information for the variable to find. If a list then iterate over the list

Returns

Variables(s) corresponding to the description(s) in the current graph, None where there is no match

Raises

og.OmniGraphError if the variable description didn't correspond to a valid variable

exception omni.graph.core.OmniGraphBindingError
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.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: Optional[List[str]] = None)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

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

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'
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.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
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)

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, gpu_ptr_kind: omni.graph.core._omni_graph_core.PtrToPtrKind = PtrToPtrKind.NA)
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

class omni.graph.core.Settings(ALLOW_IMPLICIT_GRAPH: str = '/persistent/omnigraph/allowGlobalImplicitGraph', USE_SCHEMA_PRIMS: str = '/persistent/omnigraph/useSchemaPrims', ENABLE_LEGACY_PRIM_CONNECTIONS: str = '/persistent/omnigraph/enableLegacyPrimConnections', DISABLE_PRIM_NODES: str = '/persistent/omnigraph/disablePrimNodes', VERSION: str = '/persistent/omnigraph/settingsVersion', DEFAULT_EVALUATOR: str = '/persistent/omnigraph/defaultEvaluator', PRIM_NODES: str = '/persistent/omnigraph/createPrimNodes', UPDATE_TO_USD: str = '/persistent/omnigraph/updateToUsd', UPDATE_MESH_TO_HYDRA: str = '/persistent/omnigraph/updateMeshPointsToHydra', USE_DYNAMIC_SCHEDULER: str = '/persistent/omnigraph/useDynamicScheduler', REALM_ENABLED: str = '/persistent/omnigraph/realmEnabled', CACHED_CONNECTIONS_IN_FILE: str = '/persistent/omnigraph/useCachedConnectionsForFileLoad', USE_LEGACY_PIPELINE: str = '/persistent/omnigraph/useLegacySimulationPipeline', ENABLE_LEGACY_GRAPH_EDITOR: str = 'REMOVED', PLAY_COMPUTE_GRAPH: str = '/app/player/playComputegraph', OPTIMIZE_GENERATED_PYTHON: str = '/persistent/omnigraph/generator/pyOptimize', ENABLE_PATH_CHANGED_CALLBACK: str = '/persistent/omnigraph/enablePathChangedCallback')

Class that packages up all of the OmniGraph settings handling into a common location. The settings themselves are handled through the Carbonite settings ABI, this just provides a nicer and more focused interface. Values here should also be reflected in the C++ OmniGraphSettings class.

ALLOW_IMPLICIT_GRAPH: str = '/persistent/omnigraph/allowGlobalImplicitGraph'

Constant for the setting to selectively disable the global implicit graph

CACHED_CONNECTIONS_IN_FILE: str = '/persistent/omnigraph/useCachedConnectionsForFileLoad'

Use USD metadata with connection information as a cache to speed up file load

DEFAULT_EVALUATOR: str = '/persistent/omnigraph/defaultEvaluator'

Default evaluator type for new graphs

DISABLE_INFO_NOTICE_HANDLING_IN_PLAYBACK = '/persistent/omnigraph/disableInfoNoticeHandlingInPlayback'

Disable all processing of info-only notices by OG. This is an optimization for applications which do not require any triggering of OG via USD (value_changed and path_changed callbacks, lazy-graph etc

DISABLE_PRIM_NODES: str = '/persistent/omnigraph/disablePrimNodes'

Constant for the setting to enable legacy Prim nodes to exist in the scene

ENABLE_LEGACY_GRAPH_EDITOR: str = 'REMOVED'

This setting has been removed

ENABLE_LEGACY_PRIM_CONNECTIONS: str = '/persistent/omnigraph/enableLegacyPrimConnections'

Constant for the setting to enable connections between legacy Prims and OG Nodes

ENABLE_PATH_CHANGED_CALLBACK: str = '/persistent/omnigraph/enablePathChangedCallback'

Enable the deprecated Node.pathChangedCallback. This will affect performance.

ENABLE_USD_IN_PRERENDER = '/persistent/omnigraph/enableUSDInPreRender'

Enable nodes that read USD data to be safely used within a pre-render graph

OPTIMIZE_GENERATED_PYTHON: str = '/persistent/omnigraph/generator/pyOptimize'

Optimize the Python code being output by the node generator

PLAY_COMPUTE_GRAPH: str = '/app/player/playComputegraph'

Evaluate OmniGraph when the Kit ‘Play’ button is pressed

PRIM_NODES: str = '/persistent/omnigraph/createPrimNodes'

Allow creation of the deprecated Prim node type

REALM_ENABLED: str = '/persistent/omnigraph/realmEnabled'

Enable use of Realm for scheduling

UPDATE_MESH_TO_HYDRA: str = '/persistent/omnigraph/updateMeshPointsToHydra'

Update mesh points directly to Hydra

UPDATE_TO_USD: str = '/persistent/omnigraph/updateToUsd'

Always update changes in OmniGraph to USD (can be slow)

USE_DYNAMIC_SCHEDULER: str = '/persistent/omnigraph/useDynamicScheduler'

Force use of the dynamic scheduler

USE_LEGACY_PIPELINE: str = '/persistent/omnigraph/useLegacySimulationPipeline'

Use the pre-1.3 simulation pipeline rather than the orchestration graph

USE_SCHEMA_PRIMS: str = '/persistent/omnigraph/useSchemaPrims'

Constant for the setting to force OmniGraph prims to follow the schema

VERSION: str = '/persistent/omnigraph/settingsVersion'

Version number of these settings

static generator_settings()omni.graph.tools._impl.node_generator.utils.Settings

Return the generator settings object corresponding to the current carb settings

static temporary(setting_name: str, setting_value: Any)

Generator to temporarily use a new setting value

with og.Settings.temporary(og.Settings.ALLOW_IMPLICIT_GLOBAL_GRAPH, True):

do_something_that_needs_global_graph()

class omni.graph.core.Severity

Members:

INFO

WARNING

ERROR

ERROR = Severity.ERROR
INFO = Severity.INFO
WARNING = Severity.WARNING
property name

handle) -> str

Type

(self

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.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
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._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_value_as_usd(og_type: omni.graph.core._omni_graph_core.Type, value: Any, array_limit: Optional[int] = None)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

Parameters
  • The OG type of the given data (og_type) –

  • The value read from the attribute (value) –

  • Arrays larger than this value will be truncated (array_limit) –

Returns

The USD-compatible value

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.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.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_bundle_tree_factory_interface()omni.graph.core._omni_graph_core.IBundleFactory

@return IBundleTreeFactory object that can interface with the bundle tree

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.in_compute()

Mark block of code executed at runtime. Optimizations can apply like setting values without undo support.

This function is a context manager.

Example:

with omni.graph.in_compute():
    exec(state._code_object)
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

omni.graph.core.is_in_compute()bool

Mark entry of OmniGraph runtime computation.

omni.graph.core.on_shutdown()None

For internal use only. Called to allow the Python API to clean up prior to the extension being unloaded.

omni.graph.core.python_value_as_usd(og_type: omni.graph.core._omni_graph_core.Type, value: Any)Any

Converts the given python value to the equivalent USD value

Parameters
  • The OG type of the given data (og_type) –

  • The pure python value (value) –

Returns

The USD-compatible value

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._omni_graph_core.ComputeGraph)None
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.test_failure_count()int
Returns

The number of currently active test failures.

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