DynamicAttributeAccess

class omni.graph.core.DynamicAttributeAccess(context_id: omni.graph.core._omni_graph_core.GraphContext, node: omni.graph.core._omni_graph_core.Node, attributes, dynamic_attributes: omni.graph.core._impl.database.DynamicAttributeInterface)

Bases: object

Base class for the generated classes that contain the access properties for all attributes. Each of the port containers, db.inputs/db.outputs/db.state, houses the attribute data access properties. These containers are constructed when the database is created, with hardcoded properties for all statically defined attributes. This class intercepts getattr/setattr/delattr calls to check to see if the property being requested is a dynamic attribute, and if so then it uses the properties stored in the per-node data as the access points.

So the lookup sequence goes:
db -> og.Database
.inputs -> ValuesForInput(DynamicAttributeAccess)
.myAttribute -> DynamicAttributeAccess.__getattr__

-> ValuesForInput.__getattr__ (if the above fails)

It makes the bold assumption that the attributes are all set up nicely; no duplicate names, invalid types, missing configuration, etc.

Attributes use leading underscores to minimize name collisions with the dynamically added attributes. (Double underscores would have been preferable but would have made access from the derived classes problematic.)

Members:

_context: Graph context used for evaluating this node _node: The OmniGraph node to which this data belongs _attributes: The set of attributes on this object’s port _dynamic_attributes: Container holding the per-node specification of dynamic attributes, not visible to derived classes

Methods

__init__(context_id, node, attributes, ...)

Initialize common data used for all attribute port types

get_dynamic_attributes()

Returns the dynamic attributes managed by this class, avoiding the __getattr__ override

__init__(context_id: omni.graph.core._omni_graph_core.GraphContext, node: omni.graph.core._omni_graph_core.Node, attributes, dynamic_attributes: omni.graph.core._impl.database.DynamicAttributeInterface)

Initialize common data used for all attribute port types

get_dynamic_attributes() omni.graph.core._impl.database.DynamicAttributeInterface

Returns the dynamic attributes managed by this class, avoiding the __getattr__ override