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
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?
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
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
Returns the list of interface objects corresponding to the attributes contained within the bundle
Returns the bundle being wrapped by this object
Returns the path where this bundle's data is stored
Returns the number of attributes within this bundle, 0 if the bundle is not valid
Returns true if the underlying bundle is valid, else false
- __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[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
size (Note it is required that) –
- 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
- 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
- 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
size (Note it is required that) –
- Returns
nope
- property attributes: List[omni.graph.core._impl.runtime.RuntimeAttribute]
Returns the list of interface objects corresponding to the attributes contained within the bundle
- property bundle: omni.graph.core._impl.bundles.Bundle
Returns the bundle being wrapped by this object
- property path: str
Returns the path where this bundle’s data is stored
- property size: int
Returns the number of attributes within this bundle, 0 if the bundle is not valid
- property valid: bool
Returns true if the underlying bundle is valid, else false