AttributeData#

class omni.graph.core.AttributeData#

Bases: pybind11_object

Reference to data defining an attribute’s value

Methods

__init__(*args, **kwargs)

as_read_only(self)

Returns read-only variant of the attribute data.

copy_data(self, rhs)

Copies the AttributeData data into this object's data.

cpu_valid(self)

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

get(self[, on_gpu])

Gets the current value of the attribute data

get_array(self, on_gpu, get_for_write, ...)

Gets the current value of the attribute data.

get_extended_type(self)

Returns the extended type of the current attribute data.

get_name(self)

Returns the name of the current attribute data.

get_resolved_type(self)

Returns the resolved type of the extended attribute data.

get_type(self)

Returns the type of the current attribute data.

gpu_valid(self)

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

is_read_only(self)

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

is_valid(self)

Returns whether this attribute data object is valid or not.

resize(self, element_count)

Sets the number of elements in the array represented by this object.

set(self, value[, on_gpu])

Sets the value of the attribute data

size(self)

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

Attributes

gpu_ptr_kind

Defines the memory space that GPU array data pointers live in

__init__(*args, **kwargs)#
as_read_only(
self: omni.graph.core._omni_graph_core.AttributeData,
) omni.graph.core._omni_graph_core.AttributeData#

Returns read-only variant of the attribute data.

Returns:

Read-only variant of the attribute data.

Return type:

AttributeData

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

Copies the AttributeData data into this object’s data.

Parameters:

rhs (omni.graph.core.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:

True if the data represented by this object currently has a valid value in CPU memory

Return type:

bool

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

Gets the current value of the attribute data

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#

Gets the current value of the attribute data.

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 array attribute 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

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

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

Returns:

True if the data represented by this object currently has a valid value in GPU memory

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:

True if the data represented by this object is 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:

True if the data represented by this object is valid

Return type:

bool

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

Sets the number of elements in the array represented by this object.

Parameters:

element_count (int) – Number of elements to reserve in the array

Returns:

True if the array was resized, False if not (e.g. if the attribute data was not an array type)

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

property gpu_ptr_kind#

Defines the memory space that GPU array data pointers live in