BundleContents#

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: 0>,
)#

Bases: object

—– FOR USE BY GENERATED CODE ONLY —–

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

context#

Evaluation context from which this bundle was extracted

Type:

GraphContext

read_only#

Is the bundle data read-only?

Type:

bool

Methods

__init__(context, node, attribute_name, ...)

Initialize the access points for the bundle attribute

add_attributes(types, names)

Add attributes to the bundle

attribute_by_name(attribute_name)

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

changes([clear_at_exit])

clear()

Empties out the bundle contents

insert(to_insert)

Insert new content in the existing bundle

remove(attribute_name)

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

remove_attributes(names)

Remove attributes from the bundle

Attributes

attributes

interface objects corresponding to the attributes contained within the bundle

bundle

Underlying bundle of this object

path

the path where this bundle's data is stored

size

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

valid

Validity of the underlying bundle

__init__(
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: 0>,
)#

Initialize the access points for the bundle attribute

Parameters:
  • context – Evaluation context from which this bundle was extracted

  • node – Node owning the bundle

  • attribute_name – Name of the bundle attribute

  • read_only – Is the bundle data read-only?

  • gpu_by_default – Are the bundle members on the GPU by default?

  • gpu_ptr_kind – On which device to pointers to GPU bundles live?

add_attributes(
types: List[Type],
names: List[str],
)#

Add attributes to the bundle

Parameters:
  • types – Vector of types

  • names – The names of each attribute

Note it is required that size(types) == size(names)

attribute_by_name(
attribute_name: str,
) RuntimeAttribute | None#

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

Parameters:

attribute_name – Name of the attribute to retrieve

Returns:

Bundle member with the given name, None if it was not found

Return type:

RuntimeAttribute

clear()#

Empties out the bundle contents

Raises:

og.OmniGraphError – if the bundle is not writable

insert(
to_insert: BundleContents | RuntimeAttribute | Tuple[RuntimeAttribute, str] | Tuple[Type, str],
) 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:

wrapper to the new attribute if inserting an attribute, else None

Return type:

RuntimeAttribute

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 – Name of the attribute to remove

remove_attributes(names: List[str])#

Remove attributes from the bundle

Parameters:

names – The names of each attribute to be removed

Note it is required that size(types) == size(names)

property attributes: List[RuntimeAttribute]#

interface objects corresponding to the attributes contained within the bundle

Type:

list[RuntimeAttribute]

property bundle: Bundle#

Underlying bundle of this object

Type:

Bundle

property path: str#

the path where this bundle’s data is stored

Type:

str

property size: int#

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

Type:

int

property valid: bool#

Validity of the underlying bundle

Type:

bool