Database
- class omni.graph.core.Database(node: Node)
Bases:
object
Base class for the generated database class for .ogn nodes (Python and C++ implementations)
Defines some common functionality that is the same for nodes of all types, to help cut down on the amount of redundant generated code.
Like the C++ equivalent, you can access the ABI data types normally passed to the compute as db.abi_node() and db.abi_context()
Derived classes will have these class member variables instantiated, which are manipulated here in order to keep the amount of generated code to a minimum
Methods
__init__
(node)Initialize the helper classes for roles and sizes - attribute values are defined in the derived classes
dynamic_attribute_data
(node, port_type)Gets the dynamic attribute data class stored on each node for a given port type
get_internal_state
(node, inst_id)Returns the internal state information on the node, or None if it does not exist
get_metadata
(metadata_key[, attribute])Get metadata related to this node.
get_variable
(name)Get the value of a variable with a given name.
log_error
(message[, add_context])Log an error message from a compute method, for when the compute data is inconsistent or unexpected
log_info
(message)Log an information message from a compute method, when status information is required about the compute.
log_warn
(message)Log a warning message from a compute method, when the compute is consistent but produced no results.
log_warning
(message)Log a warning message from a compute method, when the compute is consistent but produced no results.
move
(dst, src)Deprecated function.
Returns the internal state information on the node, or None if it does not exist
per_node_data
(node)Returns the per-node data for the given node
per_node_errors
(node)Returns the compute errors on the node, or [] if it does not exist
per_node_internal_state
(node)Set the memory location from which dynamic attribute values will be retrieved
set_variable
(name, value)Set the value of a variable.
shared_internal_state
(node)Returns the internal state information on the node, or None if it does not exist
Attributes
Attribute interface definition - things that don't change between nodes of the same type
Dictionary for data that is different on every node of the same type.
DEPRECATED - use omni.graph.core.AttributeRole.BUNDLE
DEPRECATED - use omni.graph.core.AttributeRole.COLOR
DEPRECATED - use omni.graph.core.AttributeRole.EXECUTION
DEPRECATED - use omni.graph.core.AttributeRole.FRAME
DEPRECATED - use omni.graph.core.AttributeRole.MATRIX
DEPRECATED - use omni.graph.core.AttributeRole.NORMAL
DEPRECATED - use omni.graph.core.AttributeRole.OBJECT_ID
DEPRECATED - use omni.graph.core.AttributeRole.PATH
DEPRECATED - use omni.graph.core.AttributeRole.POSITION
DEPRECATED - use omni.graph.core.AttributeRole.QUATERNION
DEPRECATED - use omni.graph.core.AttributeRole.TARGET
DEPRECATED - use omni.graph.core.AttributeRole.TEXCOORD
DEPRECATED - use omni.graph.core.AttributeRole.TIMECODE
DEPRECATED - use omni.graph.core.AttributeRole.FRAME
DEPRECATED - use omni.graph.core.AttributeRole.VECTOR
The graph context to which this database belongs
The node to which this database belongs
The internal state data on the node owning this database
The internal state data on the node owning this database
The internal state data on the node owning this database
- __init__(node: Node)
Initialize the helper classes for roles and sizes - attribute values are defined in the derived classes
- Parameters
node – Node to which the database belongs
- classmethod dynamic_attribute_data(node: Node, port_type: AttributePortType) DynamicAttributeInterface
Gets the dynamic attribute data class stored on each node for a given port type
- Parameters
node – Node on which the dynamic attributes should be found
port_type – Port type for the dynamic attributes to retrieve
- Returns
Interface to the dynamic attributes on the given node
- Return type
- classmethod get_internal_state(node: Node, inst_id: str)
Returns the internal state information on the node, or None if it does not exist
- Parameters
node – Node for which the internal state is to be retrieved
- Returns
Internal state object attached to the given node
- Return type
Any
- get_metadata(metadata_key: str, attribute: Optional[Attribute] = None) Optional[str]
Get metadata related to this node.
To get the metadata on the node type call db.get_metadata(ogn.MetadataKeys.UI_NAME) To get the metadata from a specific attribute call db.get_metadata(ogn.MetadataKeys.UI_NAME, db.attribute.inputs.x)
- Parameters
metadata_key – Name of the metadata value to return
attribute – Attribute on which the metadata lives. If None then look at the node type’s metadata
- Returns
Metadata value string, or None if the named metadata key did not exist
- Return type
str | None
- get_variable(name: str)
Get the value of a variable with a given name. Returns None if the variable does not exist on the graph.
- Parameters
name – Name of the variable to retrieve
- Returns
Value of the variable, or None if it does not exist on this node’s graph
- Return type
Any
- log_error(message: str, add_context: bool = True)
Log an error message from a compute method, for when the compute data is inconsistent or unexpected
- Parameters
message – Text of the message to log
add_context – If True then add the stack trace from the location of the log report
- log_info(message: str)
Log an information message from a compute method, when status information is required about the compute. Usually the compute will be successful, the information is for debugging or analysis.
- Parameters
message – Text of the message to log
- log_warn(message: str)
Log a warning message from a compute method, when the compute is consistent but produced no results. This method is identical to log_warning; both exist because there are different conventions in other code about which name to use, so to avoid wasted developer time fixing unimportant incorrect guesses both are implemented.
- Parameters
message – Text of the message to log
- log_warning(message: str)
Log a warning message from a compute method, when the compute is consistent but produced no results. This method is identical to log_warn; both exist because there are different conventions in other code about which name to use, so to avoid wasted developer time fixing unimportant incorrect guesses both are implemented.
- Parameters
message – Text of the message to log
- classmethod per_instance_internal_state(node: Node)
Returns the internal state information on the node, or None if it does not exist
- Parameters
node – Node for which the internal state is to be retrieved
- Returns
Internal state object attached to the given node
- Return type
Any
- classmethod per_node_data(node: Node) Dict[str, Any]
Returns the per-node data for the given node
- Parameters
node – OmniGraph node for which the data is to be retrieved
- Raises
og.OmniGraphError – If the per-node data is missing, most likely because the node is not initialized
- classmethod per_node_errors(node: Node)
Returns the compute errors on the node, or [] if it does not exist
- Parameters
node – Node for which the errors are to be retrieved
- Returns
List off errors reported on the node
- Return type
list[str]
- set_dynamic_attribute_memory_location(on_gpu: bool, gpu_ptr_kind: ~omni.graph.core._omni_graph_core.PtrToPtrKind = <PtrToPtrKind.NA: 0>)
Set the memory location from which dynamic attribute values will be retrieved
- Parameters
on_gpu – If true the data will be returned from GPU memory, else from CPU memory
gpu_ptr_kind – Ignored for CPU memory. For GPU memory specifies whether attribute data will be returned as a GPU pointer to the GPU memory, or a CPU pointer to the GPU memory.
- set_variable(name: str, value: Any)
Set the value of a variable. og.OmniGraphError will be raised if the variable does not exist on the graph, or if there is type mismatch
- Parameters
name – Name of the variable to set
value – New value for the variable
- Raises
OmniGraphError – If the variable did not exist or could not be set
Returns the internal state information on the node, or None if it does not exist
- Parameters
node – Node for which the internal state is to be retrieved
- Returns
Internal state object attached to the given node
- Return type
Any
- INTERFACE = {}
Attribute interface definition - things that don’t change between nodes of the same type
- PER_NODE_DATA = {}
Dictionary for data that is different on every node of the same type.
- ROLE_BUNDLE
DEPRECATED - use omni.graph.core.AttributeRole.BUNDLE
- ROLE_COLOR
DEPRECATED - use omni.graph.core.AttributeRole.COLOR
- ROLE_EXECUTION
DEPRECATED - use omni.graph.core.AttributeRole.EXECUTION
- ROLE_FRAME
DEPRECATED - use omni.graph.core.AttributeRole.FRAME
- ROLE_MATRIX
DEPRECATED - use omni.graph.core.AttributeRole.MATRIX
- ROLE_NORMAL
DEPRECATED - use omni.graph.core.AttributeRole.NORMAL
- ROLE_OBJECT_ID
DEPRECATED - use omni.graph.core.AttributeRole.OBJECT_ID
- ROLE_PATH
DEPRECATED - use omni.graph.core.AttributeRole.PATH
- ROLE_POINT
DEPRECATED - use omni.graph.core.AttributeRole.POSITION
- ROLE_QUATERNION
DEPRECATED - use omni.graph.core.AttributeRole.QUATERNION
- ROLE_TARGET
DEPRECATED - use omni.graph.core.AttributeRole.TARGET
- ROLE_TEXCOORD
DEPRECATED - use omni.graph.core.AttributeRole.TEXCOORD
- ROLE_TIMECODE
DEPRECATED - use omni.graph.core.AttributeRole.TIMECODE
- ROLE_TRANSFORM
DEPRECATED - use omni.graph.core.AttributeRole.FRAME
- ROLE_VECTOR
DEPRECATED - use omni.graph.core.AttributeRole.VECTOR
- property abi_context: GraphContext
The graph context to which this database belongs
- Type
- property internal_state
The internal state data on the node owning this database
- Type
Any
- property per_instance_state
The internal state data on the node owning this database
- Type
Any
The internal state data on the node owning this database
- Type
Any