API¶
Dependency Node¶
- class DependencyNodeHandle(node_name: str)¶
Bases:
objectLightweight wrapper around a Maya dependency node.
This class resolves a node name into an MObject and exposes a corresponding MFnDependencyNode, providing a clean and consistent interface for working with Maya nodes using the Python API 2.0.
This avoids repeated boilerplate when resolving nodes and constructing function sets.
- Parameters:
node_name (str) – Name of the Maya node to resolve.
- Raises:
ValueError – If the node cannot be resolved.
Examples
>>> node = DependencyNodeHandle("pCube1") >>> node.dependency_fn.name() 'pCube1'
- property m_object: maya.api.OpenMaya.MObject¶
The underlying Maya object.
- Returns:
The resolved dependency node.
- Return type:
om.MObject
- property dependency_fn: maya.api.OpenMaya.MFnDependencyNode¶
Function set for the dependency node.
- Returns:
Function set used to query and edit dependency node attributes.
- Return type:
om.MFnDependencyNode
DAG Node¶
- class DagNodeHandle(node_name: str)¶
Bases:
DependencyNodeHandleLightweight wrapper around a Maya DAG node.
This class extends DependencyNodeHandle by validating that the resolved node is part of the DAG and by exposing both an MDagPath and an MFnDagNode for querying DAG-specific information using the Maya Python API 2.0.
This avoids repeated boilerplate when validating DAG nodes and constructing DAG function sets.
- Parameters:
node_name (str) – Name of the Maya node to resolve.
- Raises:
ValueError – If the node cannot be resolved or if the resolved node is not a DAG node.
Examples
>>> node = DagNodeHandle("pCube1") >>> node.dag_fn.fullPathName() '|pCube1'
- property dag_path: maya.api.OpenMaya.MDagPath¶
Return the DAG path for the wrapped node.
- Returns:
The DAG path associated with the node.
- Return type:
om.MDagPath
- property dag_fn: maya.api.OpenMaya.MFnDagNode¶
Return the DAG function set for the wrapped node.
- Returns:
Function set used to query DAG-specific properties such as hierarchy, path, and child relationships.
- Return type:
om.MFnDagNode