maya.core.apicommon

Common API functions for Maya node wrappers.

The functions here are optimized versions of commonly used cmds functions, using the Maya Python API 2.0 for better performance.

ANY FUNCTIONS HERE MUST NOT HAVE ANY DEPENDENCY TO tik.maya NODE WRAPPERS.

Attributes

Functions

create_node_with_dag_modifier(→ str)

Create a DAG node using MDagModifier with undo support.

create_node_with_dg_modifier(→ str)

Create a DG (Dependency Graph) node using MDGModifier with undo support.

node_type(name)

Get the type of a Maya node.

normalize_mobject(parent)

Convert a node name or MObject to an MObject.

obj_exists(name)

Check if a Maya object exists.

Module Contents

create_node_with_dag_modifier(node_type: str, parent=None, name=None) str

Create a DAG node using MDagModifier with undo support.

Args:

node_type: Maya node type to create (e.g., ‘transform’, ‘joint’). parent: Optional parent node (name or MObject). name: Optional name for the new node.

Returns:

Full DAG path of the created node.

create_node_with_dg_modifier(node_type: str, name=None) str

Create a DG (Dependency Graph) node using MDGModifier with undo support.

Args:

node_type: Maya node type to create (e.g., ‘multiplyDivide’, ‘condition’). name: Optional name for the new node.

Returns:

Name of the created node.

node_type(name)

Get the type of a Maya node.

Faster equivalent of cmds.nodeType(name) (without inherited=True) using Maya API 2.0.

Args:

name: Name of the node.

Returns:

The node type as a string, or None if the node doesn’t exist.

normalize_mobject(parent)

Convert a node name or MObject to an MObject.

Args:

parent: Node name (str) or MObject.

Returns:

MObject representing the node.

Raises:

RuntimeError: If the node doesn’t exist.

obj_exists(name)

Check if a Maya object exists.

Faster equivalent of cmds.objExists(name) using Maya API 2.0.

Args:

name: Name of the object to check.

Returns:

True if the object exists, False otherwise.

undocommit