Type#

class omni.graph.core.Type#

Bases: pybind11_object

Full definition of the data type owned by an attribute

Methods

__init__(self, base_type, tuple_count, ...)

get_base_type_name(self)

Gets the name of this type's base data type

get_ogn_type_name(self)

Gets the OGN-style name of this type

get_role_name(self)

Gets the name of the role of this type

get_type_name(self)

Gets the name of this data type

is_compatible_raw_data(self, type_to_compare)

Does a role-insensitive comparison with the given Type.

is_matrix_type(self)

Checks if the type one of the matrix types, whose tuples are interpreted as a square array

Attributes

array_depth

(int) Zero for a single value, one for an array.

base_type

(omni.graph.core.BaseDataType) Base type of the attribute.

role

(omni.graph.core.AttributeRole) The semantic role of the type.

tuple_count

(int) Number of components in each tuple.

__init__(
self: omni.graph.core._omni_graph_core.Type,
base_type: omni.graph.core._omni_graph_core.BaseDataType,
tuple_count: int = 1,
array_depth: int = 0,
role: omni.graph.core._omni_graph_core.AttributeRole = <AttributeRole.NONE: 0>,
) None#
get_base_type_name(
self: omni.graph.core._omni_graph_core.Type,
) str#

Gets the name of this type’s base data type

Returns:

Name of just the base data type of this type, e.g. “float”

Return type:

str

get_ogn_type_name(
self: omni.graph.core._omni_graph_core.Type,
) str#

Gets the OGN-style name of this type

Returns:

Name of this type in OGN format, which differs slightly from the USD format, e.g. “float[3]”

Return type:

str

get_role_name(self: omni.graph.core._omni_graph_core.Type) str#

Gets the name of the role of this type

Returns:

Name of just the role of this type, e.g. “color”

Return type:

str

get_type_name(self: omni.graph.core._omni_graph_core.Type) str#

Gets the name of this data type

Returns:

Name of this type, e.g. “float3”

Return type:

str

is_compatible_raw_data(
self: omni.graph.core._omni_graph_core.Type,
type_to_compare: omni.graph.core._omni_graph_core.Type,
) bool#

Does a role-insensitive comparison with the given Type.

For example double[3] != pointd[3], but they are compatible and so this function would return True.

Parameters:

type_to_compare (omni.graph.core.Type) – Type to compare for compatibility

Returns:

True if the given type is 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 array_depth#

(int) Zero for a single value, one for an array.

property base_type#

(omni.graph.core.BaseDataType) Base type of the attribute.

property role#

(omni.graph.core.AttributeRole) The semantic role of the type.

property tuple_count#

(int) Number of components in each tuple. 1 for a single value (scalar), 3 for a point3d, etc.