AttributeValueHelper

class omni.graph.core.AttributeValueHelper(attribute: omni.graph.core._omni_graph_core.Attribute, instance=18446744073709551614)

Bases: omni.graph.core._impl.attribute_values.AttributeDataValueHelper

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

Methods

__init__(attribute[, instance])

Initialize the evaluation information for the Attribute

resolve_type(type_id)

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

set(new_value[, on_gpu, update_usd])

Set the value of the attribute.

Attributes

attribute

Returns the attribute this helper is wrapping

is_resolved

Returns whether the underlying attribute has a resolved type.

is_valid

Returns whether the underlying API object is valid or not

type

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

__init__(attribute: omni.graph.core._omni_graph_core.Attribute, instance=18446744073709551614)

Initialize the evaluation information for the Attribute

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

property attribute: omni.graph.core._omni_graph_core.Attribute

Returns the attribute this helper is wrapping

property is_resolved: bool

Returns whether the underlying attribute has a resolved type.

property is_valid: bool

Returns whether the underlying API object is valid or not

property type: omni.graph.core._omni_graph_core.Type

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