Hive Nodes

General Hive Nodes.

This module provides the core node classes for the Hive rigging framework. These nodes form the foundation for creating, managing, and manipulating rig components within Maya.

The module contains several key node types: - SettingsNode: Network nodes for storing arbitrary settings and metadata - ControlNode: Transform nodes with controller tag support and shape management - Guide: Specialized control nodes for rig creation and positioning - Joint: Maya joint nodes with Hive-specific functionality - Annotation: Visual annotation nodes for connecting and documenting rig elements - InputNode/OutputNode: Specialized nodes for rig input/output management

Each node class extends Maya API functionality with Hive-specific attributes, serialization, and rigging workflow utilities. The nodes support hierarchical relationships, shape management, and serialization for rig persistence.

Key Features: - UUID-based identification system - Shape library integration - Serialization/deserialization for rig persistence - Controller tag management - Parent-child hierarchy management - Transform and constraint utilities

class SettingsNode(node=None)

Bases: DGNode

A network node for storing arbitrary settings and metadata.

SettingsNode extends DGNode to provide a standardized way to store and manage configuration data for Hive components. It uses Maya network nodes as the underlying storage mechanism and includes UUID-based identification and serialization capabilities.

Key Features: - UUID-based identification for component association - Arbitrary attribute storage for configuration data - Serialization support for rig persistence - Network node-based storage (non-transform)

Variables:

id (str) – Unique identifier for this settings node within a component

id()

Returns the id attribute value. The Id value is usual added to Hivenodes to as a UUID within a given component.

Returns:

The ID string.

Return type:

str

create(name, id, nodeType='network')

Creates a network node to store animated attributes and settings.

Creates a Maya network node with the specified name and initializes it with the provided ID. The node will be set up with the necessary attributes for Hive component integration.

Parameters:
  • name (str) – The name for the new settings node

  • id (str) – Unique identifier for this settings node within the component

  • nodeType (str) – The Maya node type to create (default: “network”)

Returns:

The settings node instance that was created

Return type:

SettingsNode

serializeFromScene(*args, **kwargs)

Serializes the settings node attributes into a dictionary format.

Extracts all extra attributes from the node (excluding ID attributes) and converts them to a serializable dictionary format. This is used for rig persistence and scene export functionality.

The serialization excludes connections and focuses on attribute values only. ID attributes are skipped to avoid redundancy during component serialization.

Parameters:
  • args (tuple) – Additional positional arguments passed to parent serialization

  • kwargs (dict) – Additional keyword arguments passed to parent serialization

Returns:

List of serialized attribute dictionaries

Return type:

list[dict]

class Guide(node=None)

Bases: ControlNode

A specialized control node for rig creation and positioning.

Guide extends ControlNode to provide specialized functionality for creating and positioning rig components. Guides are used during the rig creation phase to define the pivots, control shapes and settings per control or joint.

Key Features: - Pivot and shape transform separation for precise positioning - Auto-alignment capabilities with aim and up vectors - Mirror plane support for symmetrical rigging - Shape library integration with customizable pivot shapes - Snap pivot for interactive viewport manipulation - Axis display for orientation visualization - Parent-child guide hierarchy management - Serialization for rig template persistence

static isGuide(node)

Determines if the specified node is a guide node.

A node is considered a guide if it has the ‘isGuide’ attribute. This attribute is added to guide nodes during creation to distinguish them from other transform nodes in the scene.

Parameters:

node (zoo.libs.hive.zapi.hivenodes.zapi.DGNode) – The node to check for guide status

Returns:

True if the node is a guide, False otherwise

Return type:

bool

id()

Returns the id attribute value. The Id value is usual added to Hivenodes to as a UUID within a given component.

Returns:

The ID string.

Return type:

str

aimVector()

Returns the aim vector used for auto-alignment.

The aim vector defines the direction that the guide should point towards when auto-alignment is enabled. This is used in conjunction with the up vector to determine the guide’s orientation.

Returns:

The current aim vector

Return type:

zapi.Vector

upVector()

Returns the up vector used for auto-alignment.

The up vector defines the upward direction for the guide when auto-alignment is enabled. This works with the aim vector to establish the guide’s complete orientation.

Returns:

The current up vector

Return type:

zapi.Vector

isScaleMirrored()

Returns True if this guide is mirrored using scale transformation.

When a guide is mirrored by scale, it indicates that the mirroring operation was performed using negative scale values rather than transform matrix inversion. Use mirrorPlane() to determine which world plane was used for the mirroring operation.

Returns:

True if the guide is scale-mirrored, False otherwise

Return type:

bool

mirrorPlane()

Returns the index of the world plane used for guide mirroring.

The mirror plane index corresponds to the world axis plane: 0 = YZ plane (X-axis mirror) 1 = XZ plane (Y-axis mirror) 2 = XY plane (Z-axis mirror)

This is used in conjunction with isScaleMirrored() to determine the complete mirroring state of the guide.

Returns:

The mirror plane index (0-2)

Return type:

int

isAutoAlign()

Returns whether auto-alignment is enabled for this guide.

Auto-alignment automatically orients the guide based on its relationship to parent and child guides using the aim and up vectors. When enabled, the guide will automatically update its orientation when the hierarchy changes.

Returns:

True if auto-alignment is enabled, False otherwise

Return type:

bool

aimToChild(aimVector, upVector, worldUpVector=None)

Aims this guide towards its first child guide using the specified vectors.

If this guide has no children (leaf node), it will reset its rotation to match its parent’s orientation. If it has children, it will aim towards the first child using the provided aim and up vectors.

This method handles SRT node management and shape node preservation during the aiming operation.

Parameters:
  • aimVector (zapi.Vector) – The direction vector to aim towards

  • upVector (zapi.Vector) – The up vector for orientation

  • worldUpVector (zapi.Vector or None) – Optional world up vector for reference

aimToGuide(target, aimVector, upVector, worldUpVector=None)

Aims this guide towards a target guide using the specified vectors.

Orients this guide to point towards the target guide using the provided aim and up vectors. The method handles SRT node management by temporarily unparenting children, resetting transforms, and then reparenting.

Shape node transforms are preserved throughout the operation to maintain visual consistency.

Parameters:
  • target (Guide) – The target guide to aim towards

  • aimVector (zapi.Vector) – The direction vector to aim with

  • upVector (zapi.Vector) – The up vector for orientation

  • worldUpVector (zapi.Vector or None) – Optional world up vector for reference

shape()

Returns the serialized form of the guide’s curve shapes.

Serializes the curve shapes of this guide into a dictionary format that can be used for recreation, storage, or transfer. This includes all curve CVs, degrees, and other curve-specific data.

Returns:

Serialized curve data dictionary

Return type:

dict

setShapeNode(shapeNode)

Sets the shape transform node for this guide.

Replaces any existing shape node with the provided one. The shape node is connected to the guide through the guideShape attribute and receives the guide’s ID for identification. A matrix constraint is created to maintain the spatial relationship.

Parameters:

shapeNode (zapi.DagNode) – The new shape transform node to connect

shapeNode()

Returns the control shape guide node if one exists.

The shape node is a separate transform that holds the visual representation of the animation control. It’s connected through the guideShape attribute and provides visual feedback while allowing the guide pivot to remain independent for precise positioning.

Returns:

The shape node if connected, None otherwise

Return type:

ControlNode or None

setShapeParent(parent)

Sets the parent of the separate shape transform node

Parameters:

parent (zapi.DagNode) – the new parent node

Return type:

bool

setParent(parent, shapeParent=None, useSrt=True, maintainOffset=True)

Sets the guide parent node

Parameters:
  • parent (om2.MObject or hivenode) – new parent node for the guide, can be an MObject to a transform or any hive node

  • shapeParent (DagNode)

  • useSrt (True) – IF True then the srt will be parented instead of the pivot node

  • maintainOffset (bool) – If True then the current world Transform will be maintained

Returns:

True if succeeded else False

Return type:

bool

guideParent()

This iterates the parent nodes until it finds the first parent guide then returns it and the parentId.

Return type:

tuple(Guide, str)

iterGuideParents()
isRoot()

Determines if this input node is a root in the hierarchy.

A root input node is one that has no parent input nodes. This is useful for identifying the top-level input nodes in complex rig hierarchies.

Returns:

True if this node has no input parent, False otherwise

Return type:

bool

create(**settings)

Creates a pivot and shape transforms in the scene

Parameters:

settings (dict)

Returns:

The pivot transform node

Return type:

om2.MObject

snapPivot()

Returns the locator shape node used for interactive viewport snapping.

Guides contain a locator shape due to the fact that our guides are curves which the user can’t snap to without changing snap settings. So this snapPivot is added for convenience.

The locator is scaled very small (0.001) to be invisible in normal use but provide the snap functionality.

Returns:

The locator node used for viewport snapping

Return type:

zapi.DagNode

scalePivotComponents(x, y, z)

Scales the pivot components (NURBS curves) of this guide.

Scales the NURBS curve shapes that make up the guide’s pivot visualization. The default scale multiplier ensures consistent sizing across different guide types.

Parameters:
  • x (float) – Scale factor for X axis

  • y (float) – Scale factor for Y axis

  • z (float) – Scale factor for Z axis

scaleAxisComponents(x, y, z)

Scales the axis display components of this guide.

Scales the axis shape components that show the guide’s orientation in the viewport. This helps visualize the guide’s aim and up vectors when working with guide alignment.

Parameters:
  • x (float) – Scale factor for X axis

  • y (float) – Scale factor for Y axis

  • z (float) – Scale factor for Z axis

scaleShapeComponents(x, y, z)

Scales the shape components of this guide’s shape node.

Scales the shape transform that holds the visual representation of the guide. This is typically used to adjust the visual size of the guide shape independently from the pivot scaling.

Parameters:
  • x (float) – Scale factor for X axis

  • y (float) – Scale factor for Y axis

  • z (float) – Scale factor for Z axis

replaceShape(settings)

Replaces the shape for this guide by removing the shape nodes from the shape transform before creating new ones.

Parameters:

settings (dict) – Dictionary containing shape creation parameters

Returns:

The new shape transform node

Return type:

ControlNode

pivotShapes()
addShape(shapeData)

Adds a shape to this control, handling both library names and shape data.

Convenience method that determines whether the shape parameter is a string (library name) or a dictionary (shape data) and routes to the appropriate creation method. This provides a unified interface for shape addition.

Parameters:
  • shape (str or dict) – Either a shape library name (str) or shape data dictionary

  • space (int) – The coordinate space for shape creation (default: object space)

  • replace (bool) – Whether to replace existing shapes (default: False)

  • maintainColors (bool) – Whether to preserve existing shape colors (default: False)

  • shapeType (int) – The type of shape to create (default: 0)

Returns:

Result from the underlying shape creation method

Return type:

tuple or None

setPivotShape(shapeType, shapeTransform)

Sets this guide pivot shape to be that of the given shape This copies the shape data from the given shapeTransform in world and replaces the current shape.

setDisplayAxisShapeVis(vis)

Set the display axis shape visibility

Parameters:

vis (bool)

Returns:

Return type:

displayAxisShapeVis()

The value of displayAxisShape visibility

Returns:

Return type:

bool

iterChildGuides(recursive=False)

Generator Function which returns the immediate child guides

Return type:

Generator(Guide)

serializeFromScene(skipAttributes=(), includeConnections=False, includeAttributes=(), extraAttributesOnly=True, useShortNames=True, includeNamespace=False)

Serializes this guide to dict.

Return type:

dict

deleteShapeTransform()
delete()

Deletes the control node and its associated controller tag.

Extends the standard delete functionality to also remove any attached controller tag before deleting the control node itself. This ensures proper cleanup of all associated Maya nodes.

Parameters:
  • mod (om2.MDagModifier or None) – The Maya modifier to use for deletion (optional)

  • apply (bool) – Whether to apply the modifier immediately (default: True)

Returns:

Result of the delete operation

Return type:

bool or None

createShapeTransform(settings)

Creates a new shape transform for this guide

Parameters:

settings (dict) – {“shape”: str or dict, “color”:tuple(), “name”:str}

Returns:

Return type:

control.Control

class ControlNode(node=None)

Bases: DagNode

A transform node with controller tag support and shape management capabilities.

ControlNode extends DagNode to provide specialized functionality for rig controls. It includes controller tag management, shape library integration, and SRT (Scale-Rotate-Translate) node support for complex rig hierarchies.

Key Features: - Controller tag creation and management - Shape library integration for custom control shapes - SRT node support for transform isolation - Annotation node connectivity - Serialization for rig persistence - Parent-child hierarchy management with offset maintenance

Variables:

id (str) – Unique identifier for this control within a component

id()

Returns the id attribute value. The Id value is usual added to Hivenodes to as a UUID within a given component.

Returns:

The ID string.

Return type:

str

controllerTag()

Returns the attached controller tag if one exists.

Controller tags are Maya nodes that provide additional functionality for control objects, including selection highlighting and animation layer support. This method searches through the message attribute connections to find any attached controller tag nodes.

Returns:

The controller tag node if found, None otherwise

Return type:

zapi.DGNode or None

addControllerTag(name, parent=None, visibilityPlug=None)

Creates and attaches a Maya controller tag node to this control.

Controller tags provide enhanced functionality for control object visibility control and pick walking. The tag can be parented to another controller tag for hierarchical organization.

Parameters:
  • name (str) – The name for the newly created controller tag

  • parent (ControlNode or None) – The parent control node whose controller tag will be the parent

  • visibilityPlug (om2.MPlug or None) – The visibility mode plug to connect to the tag

Returns:

The created controller tag node as a Hive DGNode

Return type:

zapi.DGNode

srt(index=0)

Returns the SRT (Scale-Rotate-Translate) node associated with this control.

SRT nodes are intermediate transform nodes used in Hive rigging to isolate different transform channels. This method searches through the message attribute connections to find the corresponding SRT node in the rig hierarchy.

The SRT node is typically connected through the control’s message attribute to the rig layer’s control array, where the SRT nodes are stored as elements.

Parameters:

index (int) – The index of the SRT node to retrieve (default: 0)

Returns:

The SRT transform node if found, None otherwise

Return type:

zapi.DagNode or None

iterSrts()

Returns an iterator over all SRT (Scale-Rotate-Translate) nodes for this control.

SRT nodes provide transform isolation in complex rig hierarchies. This method searches through the control’s message connections to find all associated SRT nodes across different rig layers and indices.

The iterator yields each SRT node found, allowing for comprehensive access to all transform isolation nodes connected to this control.

Returns:

Generator yielding SRT transform nodes

Return type:

collections.abc.Generator[zapi.DagNode]

setParent(node, maintainOffset=True, useSrt=True)

Sets the parent of this control node with SRT node support.

Extends the standard setParent functionality to support SRT (Scale-Rotate-Translate) nodes. When useSrt is True, the parenting operation is performed on the SRT node instead of the control node itself, allowing for transform isolation in complex rigs.

This method handles the hierarchy to ensure proper transform isolation while maintaining the control’s world position when maintainOffset is True.

Parameters:
  • node (zapi.DagNode or None) – The new parent node (can be None to unparent)

  • maintainOffset (bool) – Whether to maintain the current world transform position

  • useSrt (bool) – Whether to parent the SRT node instead of the control node

Returns:

Result of the parent operation

Return type:

bool or None

create(**kwargs)

Creates a control transform with the specified parameters.

Creates a new control transform node with customizable shape, color, position, and orientation. The control can be created from shape library presets or custom shape data. Supports various transform properties and Hive-specific attributes.

The kwargs parameter supports the following format:

{
    "color": (1.0, 1.0, 1.0),  # RGB color tuple
    constants.ID_ATTR: "godnode",  # Unique identifier
    "name": "godnode",  # Control name
    "rotate": [0.0, 0.0, 0.0],  # Rotation in radians
    "rotateOrder": 0,  # Maya rotate order constant
    "shape": "godnode",  # Shape name or shape data dict
    "translate": [0.0, 0.0, 0.0],  # World position
    "scale": [1.0, 1.0, 1.0],  # Scale values
    "parent": parent_node,  # Parent transform
    "shapeType": 0,  # Shape type constant
    "shapeSpace": space_constant,  # Shape creation space
    "selectionChildHighlighting": True,  # Selection highlighting
    "worldMatrix": matrix_data  # Direct world matrix
}
Parameters:

kwargs (dict) – Dictionary of creation parameters

Returns:

The created control node instance

Return type:

ControlNode

addShapeFromLib(shapeName, replace=False, maintainColors=False, shapeType=0)

Adds a shape from the Hive shape library to this control.

Loads a predefined shape from the Hive shape library and attaches it to this control transform. The shape can replace existing shapes or be added alongside them. Color information can be maintained from existing shapes if desired.

Parameters:
  • shapeName (str) – The name of the shape to load from the library

  • replace (bool) – Whether to replace existing shapes (default: False)

  • maintainColors (bool) – Whether to preserve existing shape colors (default: False)

  • shapeType (int) – The type of shape to create (default: 0)

Returns:

Tuple of (control_node, created_shapes)

Return type:

tuple[ControlNode, list[zapi.DagNode]]

addShape(shape, space=MockExt.OpenMaya.MSpace.kObject, replace=False, maintainColors=False, shapeType=0)

Adds a shape to this control, handling both library names and shape data.

Convenience method that determines whether the shape parameter is a string (library name) or a dictionary (shape data) and routes to the appropriate creation method. This provides a unified interface for shape addition.

Parameters:
  • shape (str or dict) – Either a shape library name (str) or shape data dictionary

  • space (int) – The coordinate space for shape creation (default: object space)

  • replace (bool) – Whether to replace existing shapes (default: False)

  • maintainColors (bool) – Whether to preserve existing shape colors (default: False)

  • shapeType (int) – The type of shape to create (default: 0)

Returns:

Result from the underlying shape creation method

Return type:

tuple or None

addShapeFromData(shapeData, space=MockExt.OpenMaya.MSpace.kObject, replace=False, maintainColors=False, shapeType=0)

Adds a shape to this control from serialized shape data.

Creates a new shape from serialized curve or surface data and attaches it to this control. Supports both NURBS curves and surfaces based on the shapeType parameter. Existing shapes can be replaced and color information preserved.

Parameters:
  • shapeData (dict) – Serialized shape data (curve CVs, surface data, etc.)

  • space (int) – The coordinate space for shape creation (default: object space)

  • replace (bool) – Whether to replace existing shapes (default: False)

  • maintainColors (bool) – Whether to preserve existing shape colors (default: False)

  • shapeType (int) – Type of shape to create (curve or surface, default: NURBS curve)

Returns:

Tuple of (control_node, created_shapes)

Return type:

tuple[ControlNode, list[zapi.DagNode]]

annotation()

Returns the connected annotation node if one exists.

Annotation nodes provide visual connections and documentation for rig elements. This method searches for an annotation connection through the annotation attribute and returns the annotation node if found.

Returns:

The annotation node if connected, None otherwise

Return type:

Annotation or None

deleteAnnotation(mod=None, apply=True)

Deletes the annotation node connected to this control.

Removes the annotation node that is connected to this control through the annotation attribute. The deletion can be performed with a specific modifier for batch operations.

Parameters:
  • mod (om2.MDagModifier or None) – The Maya modifier to use for deletion (optional)

  • apply (bool) – Whether to apply the modifier immediately (default: True)

delete(mod=None, apply=True)

Deletes the control node and its associated controller tag.

Extends the standard delete functionality to also remove any attached controller tag before deleting the control node itself. This ensures proper cleanup of all associated Maya nodes.

Parameters:
  • mod (om2.MDagModifier or None) – The Maya modifier to use for deletion (optional)

  • apply (bool) – Whether to apply the modifier immediately (default: True)

Returns:

Result of the delete operation

Return type:

bool or None

serializeFromScene(skipAttributes=(), includeConnections=True, includeAttributes=(), extraAttributesOnly=True, useShortNames=True, includeNamespace=False)

This method is to return a dict that is compatible with JSON

Return type:

dict

class Joint(node=None)

Bases: DagNode

A Maya joint node with Hive-specific functionality.

Joint extends DagNode to provide specialized functionality for Maya joint nodes within the Hive rigging framework. It includes intelligent parenting that maintains joint orientation, serialization support, and Hive-specific identification.

Key Features: - Intelligent parenting with joint orientation preservation - UUID-based identification for component association - Serialization for rig persistence - Joint orientation management during hierarchy changes - Scale compensation handling

Variables:

id (str) – Unique identifier for this joint within a component

id()

Returns the id attribute value. The Id value is usual added to Hivenodes to as a UUID within a given component.

Returns:

The ID string.

Return type:

str

serializeFromScene(skipAttributes=(), includeConnections=True, includeAttributes=(), extraAttributesOnly=True, useShortNames=True, includeNamespace=False)

This method is to return a dict that is compatible with JSON

Return type:

dict

setParent(parent, maintainOffset=True, mod=None, apply=True)

Sets the parent of this joint with orientation management.

Extends the standard setParent functionality to preserve joint orientation during reparenting operations. When a joint is reparented, the method calculates the appropriate joint orientation to maintain the world-space rotation, then resets local rotations to zero.

For joint-to-joint parenting, scale compensation is automatically connected to maintain proper deformation behavior.

Parameters:
  • parent (zapi.DagNode or None) – The new parent joint or transform

  • maintainOffset (bool) – Whether to maintain current world position

  • mod (om2.MDagModifier or None) – Maya modifier for batch operations (optional)

  • apply (bool) – Whether to apply the modifier immediately

create(**kwargs)

Creates a Maya joint node with the specified parameters.

Creates a new joint transform with customizable position, orientation, and Hive-specific attributes. The joint is created with proper world matrix transformation and then parented to maintain the desired position.

The method automatically sets segment scale compensation to 0 and adds the ID attribute if provided.

Parameters:

kwargs (dict) – Dictionary of creation parameters including: - name (str): Joint name - parent (zapi.DagNode): Parent transform - translate (tuple): World position - rotate (tuple): World rotation - rotateOrder (int): Rotation order - id (str): Hive identifier

Returns:

The created joint instance

Return type:

Joint

aimToChild(aimVector, upVector, useJointOrient=True)

Aims this joint towards its first child using the specified vectors.

Orients the joint to point towards its first child using the provided aim and up vectors. If the joint has no children, it resets the rotation to zero. When useJointOrient is True, the calculated rotation is stored in the jointOrient attribute and local rotation is reset to zero.

This is commonly used for setting up joint chains with proper orientation for skinning and deformation.

Parameters:
  • aimVector (zapi.Vector) – The direction vector to aim towards

  • upVector (zapi.Vector) – The up vector for orientation

  • useJointOrient (bool) – Whether to use joint orient attribute (default: True)

class Annotation(node=None)

Bases: DagNode

A visual annotation node for connecting and documenting rig elements.

Annotation extends DagNode to provide visual connections between rig elements. It creates curve-based visual links between start and end nodes with decompose matrix nodes for dynamic positioning. Annotations are used for documentation, visualization of relationships, and rig organization.

Key Features: - Dynamic curve-based visual connections - Automatic positioning through decompose matrix nodes - Attribute holder connections for metadata - Batch parenting and deletion support - Serialization for rig persistence

Variables:

_annotation_extraAttr (str) – Name of the extra attributes array

static isAnnotation(node)

Determines if the provided node has an annotation attached.

Checks whether the node has the ‘zooAnnotation’ attribute, which indicates that an annotation node is connected to it. This is used to identify nodes that participate in the annotation system.

Parameters:

node (zapi.DagNode) – The node to check for annotation attachment

Returns:

True if the node has an annotation, False otherwise

Return type:

bool

id()

Returns the id attribute value for this annotation.

The ID value is typically added to Hive nodes as a UUID within a given component to enable unique identification and reference during rig operations and serialization.

Returns:

The ID string if present, empty string otherwise

Return type:

str

setParent(parent, maintainOffset=False, mod=None, apply=True)

Sets the parent of this annotation node with extra node support.

Extends the standard setParent functionality to also parent any extra nodes associated with this annotation (decompose matrix nodes, etc.). This ensures that all related nodes move together when the annotation is reparented.

The method supports batch operations through the mod parameter for efficient scene manipulation.

Parameters:
  • parent (zapi.DagNode) – The new parent node for the annotation

  • maintainOffset (bool) – Whether to maintain current world position

  • mod (om2.MDagModifier or None) – Maya modifier for batch operations (optional)

  • apply (bool) – Whether to apply the modifier immediately

Returns:

The Maya modifier result

Return type:

om2.MDagModifier

delete(mod=None, apply=True)

Deletes the annotation node and all associated extra nodes.

Extends the standard delete functionality to also remove all extra nodes stored in the zooAnnotationExtras attribute. This includes decompose matrix nodes and other supporting nodes created during annotation setup.

The deletion can be performed with a specific modifier for batch operations.

Parameters:
  • mod (om2.MDagModifier or None) – Maya modifier for batch operations (optional)

  • apply (bool) – Whether to apply the modifier immediately

create(name, start, end, attrHolder=None, parent=None)

Each subclass needs to implement this method to build the node into the application scene The default functionality is to create a maya DagNode

Parameters:
  • name (str) – The name of the new node

  • nodeType (str) – the maya node type to create

  • parent (om2.MObject) – The parent object

  • mod (om2.MDagModifier) – The MDagModifier to add to, if none it will create one

setStartEnd(startNode, endNode)
extraNodes()
Returns:

Return type:

:iterable[zapi.DagNode]

startNode()
endNode()
attrHolder()
serializeFromScene(*args, **kwargs)

Serializes the annotation into JSON compatible data, connected nodes are stored by name.

Keyword Arguments:
  • useShortNames – If True(default) stores the short node name else the full path.

  • includeNamespace – If True stores the node namespace, defaults to False.

Return type:

dict

class InputNode(node=None)

Bases: DagNode

A specialized node for rig input management.

InputNode extends DagNode to provide specialized functionality for managing input nodes within Hive rigging framework. It supports hierarchical relationships, serialization, and input-specific identification.

Key Features: - Input-specific attribute identification - Parent-child hierarchy management for input nodes - Serialization for rig persistence - Root node detection for hierarchy analysis

static isInput(node)

Determines if the specified node is an input node.

A node is considered an input node if it has the ‘isInput’ attribute. This attribute is added to input nodes during creation to distinguish them from other transform nodes in the scene.

Parameters:

node (zoo.libs.hive.zapi.hivenodes.zapi.DGNode) – The node to check for input status

Returns:

True if the node is an input node, False otherwise

Return type:

bool

inputParent()

Finds and returns the parent input node in the hierarchy.

Iterates through the parent hierarchy to find the first node that has the ‘isInput’ attribute. Returns both the parent node instance and its ID for reference.

Returns:

Tuple of (parent_input_node, parent_id) or (None, None) if not found

Return type:

tuple[InputNode, str] or tuple[None, None]

isRoot()

Determines if this input node is a root in the hierarchy.

A root input node is one that has no parent input nodes. This is useful for identifying the top-level input nodes in complex rig hierarchies.

Returns:

True if this node has no input parent, False otherwise

Return type:

bool

iterChildInputs(recursive=False)

Generator function which returns immediate child input nodes.

Yields input nodes that are direct children of this node. The recursion parameter controls whether to traverse the entire hierarchy or only immediate children.

Parameters:

recursive (bool) – Whether to traverse all descendant levels (default: False)

Returns:

Generator yielding child input nodes

Return type:

collections.abc.Generator[InputNode]

id()

Returns the id attribute value. The Id value is usual added to Hivenodes to as a UUID within a given component.

Returns:

The ID string.

Return type:

str

create(**kwargs)

Creates an input node with specified parameters.

Creates a new transform node with customizable position, orientation, and Hive-specific attributes. The node is created as an input node with the ‘isInput’ attribute set to True.

Parameters:

kwargs (dict) – Dictionary of creation parameters including: - name (str): Node name - parent (zapi.DagNode): Parent transform - translate (tuple): World position - rotate (tuple): World rotation - rotateOrder (int): Rotation order - id (str): Hive identifier

Returns:

The created input node instance

Return type:

InputNode

serializeFromScene(skipAttributes=(), includeConnections=False, includeAttributes=(), extraAttributesOnly=True, useShortNames=True, includeNamespace=False)

This method is to return a dict that is compatible with JSON

Return type:

dict

class OutputNode(node=None)

Bases: DagNode

A specialized node for rig output management.

OutputNode extends DagNode to provide specialized functionality for managing output nodes within Hive rigging framework. It supports hierarchical relationships, serialization, and output-specific identification.

Key Features: - Output-specific attribute identification - Parent-child hierarchy management for output nodes - Serialization for rig persistence - Root node detection for hierarchy analysis

Variables:

_attrsToSkip (tuple) – Attributes to skip during serialization

static isOutput(node)

Determines if the specified node is an output node.

A node is considered an output node if it has the ‘isOutput’ attribute. This attribute is added to output nodes during creation to distinguish them from other transform nodes in the scene.

Parameters:

node (zoo.libs.hive.zapi.hivenodes.zapi.DGNode) – The node to check for output status

Returns:

True if the node is an output node, False otherwise

Return type:

bool

id()

Returns the id attribute value. The Id value is usual added to Hivenodes to as a UUID within a given component.

Returns:

The ID string.

Return type:

str

isRoot()

Determines if this output node is a root in the hierarchy.

A root output node is one that has no parent output nodes. This is useful for identifying the top-level output nodes in complex rig hierarchies.

Returns:

True if this node has no output parent, False otherwise

Return type:

bool

outputParent()

Finds and returns the parent output node in the hierarchy.

Iterates through the parent hierarchy to find the first node that has the ‘isOutput’ attribute. Returns both the parent node instance and its ID for reference.

Returns:

Tuple of (parent_output_node, parent_id) or (None, None) if not found

Return type:

tuple[OutputNode, str] or tuple[None, None]

iterChildOutputs(recursive=False)

Generator Function which returns the immediate child Output nodes

Return type:

Generator(OutputNode)

create(**kwargs)

Creates an output node with specified parameters.

Creates a new transform node with customizable position, orientation, and Hive-specific attributes. The node is created as an output node with ‘isOutput’ attribute set to True.

Parameters:

kwargs (dict) – Dictionary of creation parameters including: - name (str): Node name - parent (zapi.DagNode): Parent transform - translate (tuple): World position - rotate (tuple): World rotation - rotateOrder (int): Rotation order - id (str): Hive identifier - worldMatrix (zapi.Matrix): Direct world matrix

Returns:

The created output node instance

Return type:

OutputNode

serializeFromScene(skipAttributes=(), includeConnections=False, includeAttributes=(), extraAttributesOnly=True, useShortNames=True, includeNamespace=False)

This method is to return a dict that is compatible with JSON

Return type:

dict

setGuidesWorldMatrix(guides, matrices, skipLockedTransforms=True)

Sets the world matrix for multiple guides while preserving shape transforms.

Updates the world transform matrices for a list of guides while maintaining their shape node transforms. This is useful for positioning operations where guides need to be moved to specific positions.

The function handles SRT node management, shape node preservation, and optional locked transform handling. It creates a temporary cache to store shape transforms before applying the new matrices.

For each guide, the method: 1. Stores the current shape node transform 2. Resets SRT transforms if present 3. Applies the new world matrix 4. Restores the shape node transform if needed

The skipLockedTransforms parameter determines whether to temporarily unlock transform attributes during the operation.

Parameters:
  • guides (list[Guide]) – List of guide objects to update

  • matrices (list[zapi.Matrix]) – List of world matrices corresponding to each guide

  • skipLockedTransforms (bool) – Whether to skip locked transform attributes (default: True)

Raises:

AssertionError – If guides and matrices lists have different lengths

This module houses hive layers, hive layers are just transforms used to organize the rig/component into chunks, each layer has its own logic to deal with its children and meta nodes. Layers are intended to be the main access points to any node in attached to the rig, this is primarily done by the attached meta nodes.

class HiveLayer(*args, **kwargs)

Bases: MetaBase

Base class for hive layer meta nodes. Layers are simply for organization purposes however they are the main access points for the Dag nodes within the rig.

show(mod=None, apply=True)

Shows the layer by making its root transform visible.

Parameters:
  • mod (Optional[om2.MDGModifier]) – Optional modifier to use for the operation.

  • apply (bool) – If True, applies the modifier immediately.

hide(mod=None, apply=True)

Hides the layer by making its root transform invisible.

Parameters:
  • mod (Optional[om2.MDGModifier]) – Optional modifier to use for the operation.

  • apply (bool) – If True, applies the modifier immediately.

rootTransform()

Returns the root transform node for this layer.

Returns:

The root transform or None if not connected.

Return type:

DagNode | None

createTransform(name, parent)

Creates the layer root transform, locks and hides its transform attributes, connects it to the meta node and locks the node.

Parameters:
  • name (str) – The name for the transform.

  • parent (DagNode | None) – The parent for the transform or None for the world.

Returns:

The newly created transform.

Return type:

DagNode

delete(mod=None, apply=True)

Deletes the layer and all its associated nodes.

This includes the layer’s transform node, settings nodes, and any extra nodes connected to the layer.

Parameters:
  • mod (Optional[om2.MDGModifier]) – Optional modifier to use for the operation.

  • apply (bool) – If True, applies the modifier immediately.

Returns:

True if the meta node was deleted.

Return type:

bool

metaAttributes()

Defines the metadata attributes for the HiveLayer node.

This method sets up the standard attributes used by all Hive layers, including:

  • Extra nodes array for storing additional connected nodes

  • Root transform reference

  • Annotation support

  • Settings nodes for layer configuration

  • Tagged nodes for custom node tagging

Returns:

A list of attribute definitions in the format expected by the meta node system.

Return type:

list[dict]

updateMetaData(metaData)

Creates or updates the meta node attributes from the provided attribute definitions.

Empty definitions are skipped.

Parameters:

metaData (Iterable[AttributeDefinition | None]) – The attribute definitions to apply to the meta node.

createSettingsNode(name, attrName)

Creates a hive settings node and adds it to the meta node with the attrName as its id.

If a settings node with the attrName already exists it will be returned instead.

Parameters:
  • name (str) – The name this node will have.

  • attrName (str) – The settings node id used to find it later.

Returns:

The existing or newly created settings node.

Return type:

SettingsNode

settingsNodes()

Generator function which yields all the attached settings nodes to the meta node.

Returns:

Each settings node attached to this layer.

Return type:

Iterator[SettingsNode]

settingNode(name)

Finds and returns the settings node if it exists, this is done via the meta node.

Parameters:

name (str) – The settings node id.

Returns:

The settings node or None if not found.

Return type:

SettingsNode | None

createJoint(**kwargs)

Creates a joint based on the keyword arguments given and attaches it to this layer.

layer = Layer()
layer.createJoint(**dict(name="myJoint",
                         translate=om2.MVector(0,0,0),
                         rotate = om2.MQuaternion(0,0,0,1),
                         rotateOrder=0,
                         parent=None,
                         id="myJointid"
                         ))
Keyword Arguments:
  • name(str) – The joint name.

  • translate(zapi.Vector) – The world translation.

  • rotate(zapi.Quaternion) – The world rotation.

  • rotateOrder(int) – The rotation order.

  • parent(Joint) – The parent node.

  • id(str) – The joint id.

  • attributes(list[dict]) – Extra attributes to add to the joint.

Returns:

The newly created joint.

Return type:

Joint

findJoints(*ids)

Finds and returns all the joints with an id in ‘ids’ in the exact order of ‘ids’.

Parameters:

ids (str) – The joint ids to find.

Returns:

The joints in the order of ‘ids’, None for any id not found.

Return type:

list[Joint | None]

iterJoints(sortByHierarchy=False)

Returns the joints attached to this layer in the order they were added.

Parameters:

sortByHierarchy (bool) – Sorts the joints based on local hierarchy(depth).

Returns:

The joints attached to this layer.

Return type:

list[Joint]

addJoint(node, jointId)

Attaches a joint to this layer with the given id.

The joint id attribute is added to the joint if it doesn’t already exist.

Parameters:
  • node (Joint) – The joint to attach.

  • jointId (str) – The joint id.

joints()

Returns all the joints that are attached to this layer in the order they were added.

Returns:

The joints attached to this layer.

Return type:

list[Joint]

disconnectAllJoints(modifier=None, apply=True)

Disconnects all joints from this layer.

Note

This doesn’t delete the joints but does delete the joint plug elements on this layer.

Parameters:
  • modifier (Optional[om2.MDGModifier]) – Modifier to run the disconnect on.

  • apply (bool) – Apply the mod automatically if true.

deleteJoint(jntId)

Deletes the joint with the given id and its plug element on this layer.

Parameters:

jntId (str) – The joint id to delete.

iterJointPlugs()

Generator function which yields each joint compound element plug on this layer.

Returns:

Each joint element plug.

Return type:

Iterator[Plug]

joint(name)

Returns the joint with the id attached to this layers meta node.

Parameters:

name (str) – The joint id.

Returns:

The joint or None if not found.

Return type:

Joint | None

rootJoints()

Generator function which yields the joints of this layer which don’t have a parent joint from this layer.

Returns:

Each root joint.

Return type:

Iterator[Joint]

addExtraNode(node)

Adds a single hive node to the extra nodes meta attribute.

Parameters:

node (DGNode) – A hive node to add to the meta attribute.

addExtraNodes(objects)

Adds the nodes to the extra nodes meta attribute.

Parameters:

objects (Iterable[DGNode]) – The nodes to add.

extraNodes()

Generator function which yields the nodes attached to the extra nodes meta attribute.

Returns:

Each extra node.

Return type:

Iterator[DGNode]

addTaggedNode(node, tagId)

Adds a node to the layer with a specific tag ID, see addTaggedNode().

Parameters:
  • node (DGNode) – The node to tag.

  • tagId (str) – The unique identifier for the tag.

taggedNode(tagId)

Retrieves a node by its tag ID.

Parameters:

tagId (str) – The unique identifier of the tag to search for.

Returns:

The tagged node if found, otherwise None.

Return type:

DGNode | None

taggedNodes()

Generator function which yields all nodes that have been tagged on this layer.

Returns:

Each tagged node.

Return type:

Iterator[DGNode]

findTaggedNodes(*tagIds)

Finds multiple tagged nodes by their tag IDs.

Parameters:

tagIds (str) – Variable number of tag IDs to search for.

Returns:

A list of nodes in the same order as the input tag IDs, None for any not found.

Return type:

list[DGNode | None]

createAnnotation(name, start, end, attrHolder=None, parent=None)

Creates an annotation between the start and end nodes and attaches it to this layer.

If an annotation between the start and end nodes already exists it will be returned instead. The annotation will be hidden if either the start or end node is hidden.

Parameters:
  • name (str) – The name for the annotation.

  • start (DagNode) – The start transform that the annotation will be attached.

  • end (DagNode) – The end transform that the annotation will be attached.

  • attrHolder (DGNode | None) – The node that will have the annotation connected to by a message attribute. useful for queries.

  • parent (DagNode | None) – The parent for the annotation.

Returns:

The existing or newly created annotation.

Return type:

Annotation

annotation(startNode, endNode)

Returns the annotation attached to this layer between the start and end nodes.

Parameters:
  • startNode (DagNode) – The annotation start node.

  • endNode (DagNode) – The annotation end node.

Returns:

The annotation or None if not found.

Return type:

Annotation | None

annotations()

Generator function which yields the annotations attached to this layer.

Returns:

Each annotation.

Return type:

Iterator[Annotation]

serializeFromScene()

Serializes the layer into the definition format, the base layer has no data.

Returns:

An empty dict.

Return type:

dict

class HiveComponentLayer(*args, **kwargs)

Bases: HiveLayer

Rig level layer which parents all the rig components and stores the component groups.

id = 'HiveComponentLayer'
metaAttributes()

Defines the metadata attributes for the component layer, adding the component groups attribute to the base layer attributes.

Returns:

A list of attribute definitions in the format expected by the meta node system.

Return type:

list[dict]

components(depthLimit=256)

Returns all the component meta nodes in order as a list.

Parameters:

depthLimit (int) – The depth limit to search for components.

Returns:

The component meta nodes.

Return type:

list[MetaBase]

iterComponents(depthLimit=256)

Generator function that iterates the components and yields each meta node.

Parameters:

depthLimit (int) – The depth limit to search for components.

Returns:

Each component meta node.

Return type:

Iterator[MetaBase]

iterGroupPlugs()

Generator function that iterates the componentGroups plug elements on the component layer.

Returns:

Each group element plug.

Return type:

Iterator[Plug]

groupElementPlug(name)

Returns the Component group element Plug from the component Layer.

Parameters:

name (str) – The group name to find.

Returns:

None if the group name can’t be found.

Return type:

Plug | None

groupNames()

Generator function which yields each non empty group name.

Returns:

Each group name.

Return type:

Iterator[str]

renameGroup(oldName, newName)

Renames a component group.

Parameters:
  • oldName (str) – The existing group name.

  • newName (str) – The new group name.

Returns:

True if the group was found and renamed.

Return type:

bool

removeFromGroup(name, components)

Removes a list of components from the component group.

Parameters:
  • name (str) – The group name to remove the component from.

  • components (Iterable[component.Component]) – A list of components to remove.

Returns:

True if the group exists.

Return type:

bool

createGroup(name, components=None)

Creates a component group on the component layer.

Parameters:
  • name (str) – The new component group.

  • components (Optional[Iterable[component.Component]]) – The components to add or None.

Returns:

True if the component group was added, None if no free group element exists.

Raise:

errors.ComponentGroupAlreadyExists

Return type:

Optional[bool]

addToGroup(name, components)

Adds the components to the component group.

Parameters:
  • name (str) – The component group name.

  • components (Iterable[component.Component]) – A list of component instances.

Returns:

True if at least one component added.

Return type:

bool

removeGroup(name)

Removes the entire component group and its children.

Parameters:

name (str) – The group name to remove.

Returns:

True if the group was removed.

Return type:

bool

iterComponentsNamesForGroup(name)

Generator function to iterate over the component name and side of each component in a group.

Parameters:

name (str) – The name of the group to iterate.

Returns:

Each component (name, side).

Return type:

Iterator[tuple[str, str]]

class HiveInputLayer(*args, **kwargs)

Bases: HiveLayer

Layer containing the component input nodes which drive the component from other components.

id = 'HiveInputLayer'
metaAttributes()

Defines the metadata attributes for the input layer, adding the inputs attribute to the base layer attributes.

Returns:

A list of attribute definitions in the format expected by the meta node system.

Return type:

list[dict]

rootInput()

Returns the root Input node which is determined by the isRoot flag.

Returns:

The root input node or None if not found.

Return type:

InputNode | None

rootIONodes()

Generator function which yields each input node flagged as root.

Returns:

Each root input node.

Return type:

Iterator[InputNode]

rootInputPlug()

Returns the input element plug which has the isInputRoot flag set.

Returns:

The root input element plug or None if not found.

Return type:

Plug | None

createInput(name, **kwargs)

Creates a new input node, parents it to the layer root and attaches it to this layer.

See hnodes.InputNode.create() for the supported keywords.

Parameters:

name (str) – The input node name.

Returns:

The newly created input node.

Return type:

InputNode

addInputNode(inputNode, asRoot=False)

Attaches an existing input node to this layer.

Parameters:
  • inputNode (InputNode) – The input node to attach.

  • asRoot (bool) – Whether the input node is a root input.

deleteInput(inputId)

Deletes the input node with the given id and its element plug.

Parameters:

inputId (str) – The input node id.

clearInputs()

Deletes all root input nodes from the layer and clears the inputs array plug.

inputPlugById(inputId)

Returns the input plug by its node ID. If no input exists None will be returned.

Parameters:

inputId (str) – The input node id to find.

Returns:

The input element plug.

Return type:

Plug | None

inputSourcePlugById(inputId)

Returns the sourceInputs array plug for the given input id.

Parameters:

inputId (str) – The input node id.

Returns:

The sourceInputs plug or None if the input isn’t found.

Return type:

Plug | None

inputNode(name)

Returns the input node for the given id.

Parameters:

name (str) – The input node id.

Returns:

The input node or None if the id doesn’t exist.

Raises:

errors.InvalidInputNodeMetaData if the id exists but has no node connected.

Return type:

InputNode | None

findInputNodes(*ids)

Finds and returns the input nodes from the layer which match the provide ids.

Parameters:

ids (str) – A list of input node ids to find.

Returns:

Returns a list of InputNodes in the order of ‘ids’, None for any not found.

Return type:

list[InputNode | None]

hasInput(name)

Returns whether an input node with the given id exists.

Parameters:

name (str) – The input node id.

Returns:

True if the input node exists.

Return type:

bool

inputs()

Generator function which yields each input node attached to this layer.

Returns:

Each input node.

Return type:

Iterator[InputNode]

serializeFromScene()

Serializes the layer root extra attributes and the root input node hierarchies into the definition format.

Returns:

The input layer definition data.

Return type:

dict

class HiveOutputLayer(*args, **kwargs)

Bases: HiveLayer

Layer containing the component output nodes which other components can be driven by.

id = 'HiveOutputLayer'
metaAttributes()

Defines the metadata attributes for the output layer, adding the outputs attribute to the base layer attributes.

Returns:

A list of attribute definitions in the format expected by the meta node system.

Return type:

list[dict]

rootIONodes()

Generator function which yields each output node flagged as root.

Returns:

Each root output node.

Return type:

Iterator[OutputNode]

addOutputNode(outputNode)

Attaches an existing output node to this layer.

Parameters:

outputNode (OutputNode) – The output node to attach.

outputPlugById(outputId)

Returns the output plug by its ID. If no output exists None will be returned.

Parameters:

outputId (str) – The Output node id to find.

Returns:

The output element plug.

Return type:

Plug | None

outputNodePlugById(outputId)

Returns the output node message plug for the given output id.

Parameters:

outputId (str) – The output node id.

Returns:

The output node plug or None if not found.

Return type:

Plug | None

findOutputNodes(*ids)

Finds and returns the output nodes from the layer which match the provide ids.

Parameters:

ids (str) – The output node ids to find.

Returns:

The output nodes in the order of ‘ids’, None for any not found.

Return type:

list[OutputNode | None]

outputs()

Generator function which yields each output node attached to this layer.

Returns:

Each output node.

Return type:

Iterator[OutputNode]

hasOutput(name)

Returns whether an output node with the given id exists.

Parameters:

name (str) – The output node id.

Returns:

True if the output node exists.

Return type:

bool

outputNode(name)

Returns the output node for the given id.

Parameters:

name (str) – The output node id.

Returns:

The output node or None if the id doesn’t exist.

Raises:

errors.InvalidOutputNodeMetaData if the id exists but has no node connected.

Return type:

OutputNode | None

createOutput(name, **kwargs)

Creates a new output node, parents it to the layer root and attaches it to this layer.

See hnodes.OutputNode.create() for the supported keywords.

Parameters:

name (str) – The output node name.

Returns:

The newly created output node.

Return type:

OutputNode

deleteOutput(outputId)

Deletes the output node with the given id and its element plug.

Parameters:

outputId (str) – The output node id.

clearOutputs()

Deletes all root output nodes from the layer and clears the outputs array plug.

Returns:

Returns the undo dg modifier.

Return type:

om2.MDGModifier

serializeFromScene()

Serializes the layer root extra attributes and the root output node hierarchies into the definition format.

Returns:

The output layer definition data.

Return type:

dict

class HiveGuideLayer(*args, **kwargs)

Bases: HiveLayer

Layer containing the component guides, guide settings, annotations and live link state.

id = 'HiveGuideLayer'
serializeFromScene(skipAttributes=(), includeConnections=True, extraAttributesOnly=False)

Serializes the guide hierarchy, guide settings and guide layer metadata into the definition format.

Parameters:
  • skipAttributes (Iterable[str]) – Currently unused.

  • includeConnections (bool) – Currently unused.

  • extraAttributesOnly (bool) – Currently unused.

Returns:

The guide layer definition data.

Return type:

dict

metaAttributes()

Defines the metadata attributes for the guide layer, adding the guides, visibility, pin, live link, annotation group and DG graph attributes to the base layer attributes.

Returns:

A list of attribute definitions in the format expected by the meta node system.

Return type:

list[dict]

isPinned()

Returns whether the guides are currently pinned.

Returns:

True if pinned, False if pinned or the layer doesn’t exist.

Return type:

bool

alignGuides()

Auto aligns every non root guide which has autoAlign enabled.

Guides with a child guide aim at the first child using the guide aim and up vectors, guides without a child inherit the rotation of their parent guide.

iterGuideCompound()

Generator function which yields each guide compound element plug.

Returns:

Each guide element plug.

Return type:

Iterator[Plug]

addChildGuide(guide)

Attaches a guide node to this layer.

Parameters:

guide (Guide) – The guide to attach to this layer.

Raises:

ValueError if the guide isn’t a DagNode instance.

createGuide(**kwargs)

Creates a guide node and attaches it to the guideLayer.

Keyword Arguments:
  • (str) (pivotShape) – The guide unique identifier relative to the guideLayer instance.

  • (dict) (shapeTransform) – The guide name.

  • (list[float]) (pivotColor) – The translate x,y,z in world space.

  • (list[float]) – The rotation x,y,z in world space.

  • (list[float]) – The scale x,y,z in world space.

  • dict) (shape (str or) – If str then the shape name in the shapelib else the serialized shapes.

  • (list[float]) – The shape color to use in the case where ‘shape’ is a string.

  • (dict) – The shape pivot transform, same transform keys as this method.

  • zapi.DagNode) (parent (str or) – The parent guide id or None for the layer root.

  • (bool) (selectionChildHighlighting) – Whether this guide is the root guide of the the component.

  • zapi.Matrix) (matrix (list[float] or) – The worldMatrix for the guide which takes priority over the local transform.

  • zapi.Matrix) – The local matrix for the guide.

  • (list[dict]) (attributes) – The serialized srt transforms to create above the guide.

  • (bool)

  • (str)

  • (list[float])

  • (list[dict])

Keyword:

rotateOrder (int): The rotate order using the attrtypes.kConstant value.

Returns:

The newly created guide.

Return type:

Guide

g= GuideLayer().create()
g.createGuide({"name": "godnode",
...                "translate": [0.0, 0.0, 0.0],
...                "rotate": [0.0, 0.0, 0.0],
...                "rotateOrder": 0,
...                "shape": "godnode",
...                "id": "godnode",
...                "children": [],
...                "color": [],
...                "selectionChildHighlighting": False
...                "autoAlign": True,
...                "shapeTransform": {"translate": [0.0,0.0,0.0], "scale": [1,1,1],
...                                 "rotate": [0.0,0.0,0.0],
...                "rotateOrder": 0}
...                })
duplicateGuide(guide, name, guideId, parent=None)

Creates a new guide from the serialized data of an existing guide.

Parameters:
  • guide (Guide) – The guide to duplicate.

  • name (str) – The name for the new guide.

  • guideId (str) – The id for the new guide.

  • parent (Guide | None) – The parent for the new guide, defaults to the source guide.

Returns:

The new guide.

Return type:

Guide

guideSettings()

Returns the guide settings node.

Returns:

The guide settings node or None if it doesn’t exist.

Return type:

SettingsNode | None

createSrtBuffer(controlId, name)

Generates a new transform node directly above the guide.

Parameters:
  • controlId (str) – The guide id to add the srt too.

  • name (str) – The shortname for the new srt transform.

Returns:

The created srt or None if the guide doesn’t exist.

Return type:

DagNode | None

deleteGuides(*guideIds)

Deletes the guides with the given ids from the layer.

The guides and their shapes are deleted first, then any guide compound elements which no longer have a guide, then any annotations without a start or end node.

Parameters:

guideIds (str) – The guide ids to delete.

srt(name, index=0)

Returns the srt for the given guide id.

Parameters:
  • name (str) – The guide id.

  • index (int) – The srt index for the guide, defaults to 0 being the root srt.

Returns:

The srt node or None if not found.

Return type:

DagNode | None

findGuides(*guideIds)

Finds and returns the guides with the given ids in the order of ‘guideIds’.

Parameters:

guideIds (str) – The guide ids to find.

Returns:

The guides, None for any id not found.

Return type:

list[Guide | None]

isGuidesVisible()

Returns whether the guide pivots are visible.

Returns:

The guideVisibility attribute value.

Return type:

bool

isGuideControlVisible()

Returns whether the guide control shapes are visible.

Returns:

The guideControlVisibility attribute value.

Return type:

bool

setGuideControlVisible(state, mod=None, apply=True)

Sets all guide control shapes visible state.

Parameters:
  • state (bool) – Visible if True, false otherwise.

  • mod (Optional[om2.MDGModifier]) – Modifier to run the set visible on.

  • apply (bool) – Apply the mod automatically if true.

setGuidesVisible(state, includeRoot=True, mod=None, apply=True)

Sets the guide pivots and annotations visible state.

Parameters:
  • state (bool) – Visible if True, false otherwise.

  • includeRoot (bool) – Whether the root guide should be included.

  • mod (Optional[om2.MDGModifier]) – Modifier to run the set visible on.

  • apply (bool) – Apply the mod automatically if true.

Returns:

The modifier used.

Return type:

om2.MDGModifier

guide(name)

Returns the guide for the given id, this will use the meta node connections to find the correct guide.

Parameters:

name (str) – The guide id eg. upr.

Returns:

The guide or None if not found.

Return type:

Guide | None

iterGuides(includeRoot=True)

Iterate through the guides which are connected to this layer.

Iteration order is based on the order the guides were added to the layer regardless of Dag order.

Parameters:

includeRoot (bool) – Whether the root guide should be included.

Returns:

Each guide.

Return type:

Iterator[Guide]

setGuideShapeTransform(guideId, guideShape, deleteExisting=True)

Connects the shape transform to the guide element, replacing the existing one.

Parameters:
  • guideId (str) – The guide id.

  • guideShape (DagNode) – The guide shape transform.

  • deleteExisting (bool) – If True the existing shape transform will be deleted.

guideCount()

Returns the number of guide elements on this layer.

Returns:

The guide element count.

Return type:

int

guidePlugById(guideId)

Returns the guide compound element plug for the given guide id.

Parameters:

guideId (str) – The guide id.

Returns:

The guide element plug or None if not found.

Return type:

Plug | None

guideNodePlugById(guideId)

Returns the guide node message plug for the given guide id.

Parameters:

guideId (str) – The guide id.

Returns:

The guide node plug or None if not found.

Return type:

Plug | None

sourceGuidePlugById(guideId, sourceIndex)

Returns the source guide element plug for the given guide id.

Parameters:
  • guideId (str) – The guide id.

  • sourceIndex (int) – The source guide element index.

Returns:

The source guide element plug or None if the guide isn’t found.

Return type:

Plug | None

guideRoot()

Returns the root guide of this layer.

Returns:

The root guide or None if not found.

Return type:

Guide | None

Determines if the current layer is set to be linked to the live guiding system.

Returns:

True if live link is active.

Return type:

bool

Live links the guides on the current guideLayer to the provided offsetNode.

The guide local, world and parent matrices are connected to the offsetNode transforms so the deform layer can follow the guides.

Parameters:
  • offsetNode (SettingsNode) – The input guide offset node which contains the local matrices.

  • state (bool) – If True the guides will be connected to the offsetNode, if False any existing live link connections and nodes will be removed.

setManualOrient(state)

Sets the autoAlign state on all non root guides.

Parameters:

state (bool) – If True the guides will be manually oriented ie. autoAlign is disabled.

delete(mod=None, apply=True)

Unlocks all guides then deletes the layer, see HiveLayer.delete().

Parameters:
  • mod (Optional[om2.MDGModifier]) – Optional modifier to use for the operation.

  • apply (bool) – If True, applies the modifier immediately.

Returns:

True if the meta node was deleted.

Return type:

bool

class HiveRigLayer(*args, **kwargs)

Bases: HiveLayer

Layer containing the component animation controls, srts, space switches and the control panel.

id = 'HiveRigLayer'
controlPanel()

Returns the controlPanel settings node.

Returns:

The Control panel node from the scene.

Return type:

SettingsNode | None

metaAttributes()

Defines the metadata attributes for the rig layer, adding controls, space switching, the control selection set and DG graph attributes to the base layer attributes.

Returns:

A list of attribute definitions in the format expected by the meta node system.

Return type:

list[dict]

createSelectionSet(name, parent)

Creates the control selection set and attaches it to this layer.

Parameters:
  • name (str) – The node name to use.

  • parent (ObjectSet | None) – The parent object set to parent too.

Returns:

Returns the newly create selectionSet or the existing one.

Return type:

ObjectSet

selectionSet()

Returns the control selection set.

Returns:

The selection set or None if it doesn’t exist.

Return type:

ObjectSet | None

createSpaceSwitch(**constraintKwargs)

Creates a space switch constraint and sets up the metadata on the rigLayer.

Parameters:

constraintKwargs – The space kwargs as zoo.libs.maya.zapi.spaceswitching.buildConstraint().

Returns:

The created constraint.

Return type:

spaceswitching.Constraint

addSpaceSwitchNode(driven, name)

Adds the specified driven node with the name as the id/attributeName for a spaceSwitch.

Parameters:
  • driven (DagNode) – The driven transform which contains the constraint.

  • name (str) – The attribute name for the spaceSwitch.

spaceSwitches()

Iterates the spaces switches on the rigLayer and yields each constraint class.

Returns:

Each space switch constraint.

Return type:

Iterator[spaceswitching.Constraint]

createControl(**kwargs)

Creates a control on the RigLayer along with its srts.

The “parent” keyword can be a control id, “root” or empty to parent to the layer root. See hnodes.ControlNode.create() for the supported keywords.

Returns:

The newly created control.

Return type:

ControlNode

control(name)

Returns the control node with the given id.

Parameters:

name (str) – The control id to find.

Returns:

The control node.

Raises:

errors.MissingControlError

Return type:

ControlNode

controlForSrt(srt)

Finds and returns the rig control for the given SRT node.

Parameters:

srt (DagNode) – The srt node to filter.

Returns:

Either the found control Node or None.

Return type:

DagNode | None

srts()

Generator function which yields all srts of the rigLayer.

Returns:

Each srt node on the RigLayer.

Return type:

Iterator[DagNode]

srt(name, index=0)

Returns the srt for the given control id.

Parameters:
  • name (str) – The control Id ie. “upr”.

  • index (int) – The srt index for the control, defaults to 0 being the root srt.

Returns:

The srt node or None if not found.

Return type:

DagNode | None

createSrtBuffer(controlId, name)

Generates a new transform node directly above this control.

Parameters:
  • controlId (str) – The hive control id to add the srt too.

  • name (str) – The shortname for the new srt transform.

Returns:

The created srt or None if the control doesn’t exist.

Return type:

DagNode | None

addControl(control)

Adds the give ControlNode instance to the rigLayer.

Parameters:

control (ControlNode) – The control to add. Should not already be attached to the layer.

iterControlPlugs()

Generator function which yields all control compound element plugs on the rigLayer.

Returns:

Each control element plug.

Return type:

Iterator[Plug]

iterControls(recursive=False)

Generator function which yields all controls on the rigLayer.

Parameters:

recursive (bool) – Whether to recursively search for controls in child rig layer layers e.g. child components.

Returns:

Each control.

Return type:

Iterator[ControlNode]

findControls(*ids)

Returns all the controls with the given ids in the specified order, if the control isn’t found, then None is returned in its place.

Parameters:

ids (str) – The control unique ids to search for.

Returns:

The controls in the order of ‘ids’.

Return type:

list[ControlNode | None]

controlPlugById(name)

Returns the control element plug for the given control id.

Parameters:

name (str) – The control id to search for.

Returns:

The control element plug or None if not found.

Return type:

Plug | None

serializeFromScene()

Serializes the rig layer settings nodes into the definition format.

Returns:

The rig layer definition data.

Return type:

dict

class HiveDeformLayer(*args, **kwargs)

Bases: HiveLayer

Layer containing the component deformation joints, joint selection set and live link state.

id = 'HiveDeformLayer'
metaAttributes()

Defines the metadata attributes for the deform layer, adding the live link and joint selection set attributes to the base layer attributes.

Returns:

A list of attribute definitions in the format expected by the meta node system.

Return type:

list[dict]

Determines if the current layer is set to be linked to the live guiding system.

Returns:

True if live link is active.

Return type:

bool

createSelectionSet(name, parent)

Creates and parent a new objectSet and attaches it to this layer via “hiveJointSelectionSet” attribute.

Parameters:
  • name (str) – The name for the new objectSet.

  • parent (ObjectSet | None) – The parent objectSet.

Returns:

The new selection set or the existing one.

Return type:

ObjectSet

selectionSet()

Returns the selection set attached to this layer via “hiveJointSelectionSet” attr.

Returns:

The selection set for the layer if Any.

Return type:

ObjectSet | None

delete(mod=None, apply=True, deleteJoints=True)

Deletes the layer, see HiveLayer.delete().

Parameters:
  • mod (Optional[om2.MDGModifier]) – Optional modifier to use for the operation.

  • apply (bool) – If True, applies the modifier immediately.

  • deleteJoints (bool) – If True the layer joints will also be deleted.

Returns:

True if the meta node was deleted.

Return type:

bool

Live links the joints on the current deformLayer to the bound skin clusters.

This is done by directly connected the worldInverseMatrix plug to the skin clusters bindPreMatrix. By Doing this we allow the joints transforms to move without effect the skin.

Parameters:
  • offsetNode (hnodes.SettingsNode) – The input guide offset node which contains the local matrices.

  • idMapping (Optional[dict[str, Iterable[str]]]) – The guide id to joint ids mapping defined by the component.

  • state (bool) – If True then the joints will be connected to the bindPreMatrix and the offsetNode matrices will be connected to the local transform of the joint.

  • modifier (Optional[om2.MDGModifier]) – The modifier to add the operations to, a new one is created if None.

Returns:

The maya dgModifier which handles undo or None if the state is already set.

Return type:

Optional[om2.MDGModifier]

Connects each mapped joint to the guide offset matrices and its skin clusters bindPreMatrix.

Parameters:
  • offsetNode (hnodes.SettingsNode) – The input guide offset node which contains the local matrices.

  • modifier (om2.MDGModifier) – The modifier to add the operations to.

  • idMapping (dict[str, Iterable[str]]) – The guide id to joint ids mapping defined by the component.

  • apply (bool) – If True the modifier will be applied.

Returns:

The modifier.

Return type:

om2.MDGModifier

Disconnects the joints from the skin clusters bindPreMatrix keeping the current values.

Parameters:
  • modifier (om2.MDGModifier) – The modifier to add the operations to.

  • apply (bool) – If True the modifier will be applied.

Returns:

The modifier.

Return type:

om2.MDGModifier

serializeFromScene()

Serializes the deform layer metadata ie. joint color into the definition format.

Returns:

The deform layer definition data or an empty dict if there’s no metadata.

Return type:

dict

class HiveGeometryLayer(*args, **kwargs)

Bases: HiveLayer

Rig level layer containing the rig geometry.

id = 'HiveGeometryLayer'
metaAttributes()

Defines the metadata attributes for the geometry layer, adding the geometry attribute to the base layer attributes.

Returns:

A list of attribute definitions in the format expected by the meta node system.

Return type:

list[dict]

addGeometry(geo)

Attaches the geometry to the next available geometry element.

Parameters:

geo (DagNode) – The geometry node to attach.

Returns:

True once attached.

Return type:

bool

serializeFromScene()

Serializes the geometry layer into the definition format.

Returns:

The geometry layer definition data which currently has no data.

Return type:

dict

geometryPlugs()

Returns the geometry array plug.

Returns:

The geometry array plug.

Return type:

Plug

geometry()

Generator returning the geometry nodes connected to this layer.

Returns:

Each connected geometry node.

Return type:

Iterator[DagNode]

class HiveXGroupLayer(*args, **kwargs)

Bases: HiveLayer

Layer for nodes which shouldn’t inherit the component transform.

id = 'HiveXGroupLayer'
serializeFromScene()

Serializes the layer into the definition format, the xGroup layer has no data.

Returns:

An empty dict.

Return type:

dict

class HiveComponent(*args, **kwargs)

Bases: MetaBase

Hive component meta node. A component is a modular piece of a rig which contains multiple layers for each stage of the rig ie. guides, deform, rig.

id = 'HiveComponent'
delete(mod=None)

Deletes the component and its associated transform hierarchy.

This method first unlocks and deletes the root transform of the component, then proceeds with the standard meta node deletion.

Parameters:

mod (Optional[om2.MDGModifier]) – Optional modifier to use for the operation.

Returns:

True if the meta node was deleted.

Return type:

bool

serializeFromScene(layerIds=None)

Serializes the component from the root transform down using the individual layers, each layer has its own logic so see those classes for information.

If the guides haven’t been built the cached definition data on the meta node is used instead.

Parameters:

layerIds (Iterable[str] | None) – An iterable of Hive layer id types which should be serialized, if None all layers will be serialized.

Returns:

The full component dict.

Return type:

dict

metaAttributes()

Defines the metadata attributes for the HiveComponent node.

This method sets up the standard attributes used by all Hive components, including:

  • Component identification attributes (name, side, type, version)

  • Build state flags (hasGuide, hasSkeleton, hasRig, etc.)

  • Component group and root transform references

  • Component definition cache attributes

  • Tagged nodes support

Returns:

A list of attribute definitions in the format expected by the meta node system.

Return type:

list[dict]

rawDefinitionData()

Retrieves the raw definition data stored in the component’s attributes.

This method collects definition data from various cached attributes on the component, including space switching information, layer data, and other metadata. The data is returned in a structured dictionary format.

Returns:

A dictionary containing the component’s definition data with the following structure:

Return type:

dict[str, Any]

{
    'spaceSwitch': str,  # JSON string of space switching data
    'info': str,         # JSON string of general component info
    'driver': str,       # JSON string of driver data (if any)
    'guide': dict,       # Guide layer data
    'input': dict,       # Input layer data
    'output': dict,      # Output layer data
    'rig': dict,         # Rig layer data
    'deform': dict,      # Deform layer data
    'geometry': dict,    # Geometry layer data
    'xgroup': dict       # XGroup layer data
}
saveDefinitionData(data)

Saves the definition data to the component’s attributes.

This method takes a dictionary of definition data and saves it to the appropriate attributes on the component. Attributes which fail to be set are logged at debug level.

Parameters:

data (dict[str, str]) – A dictionary of attribute name to string data.

rootTransform()

Returns the root transform node for this component.

Returns:

The root transform or None if not connected.

Return type:

DagNode | None

createTransform(name, parent)

Creates the component root transform, locks and hides its transform attributes, connects it to the meta node and locks the node.

Parameters:
  • name (str) – The name for the transform.

  • parent (DagNode | None) – The parent for the transform or None for the world.

Returns:

The newly created transform.

Return type:

DagNode

outputLayer()

Returns the OutputLayer class instance from the meta node attached to this root.

Returns:

The OutputLayer attached to this root or None if it doesn’t exist.

Return type:

HiveOutputLayer | None

inputLayer()

Returns the InputLayer class instance from the meta node attached to this root.

Returns:

The InputLayer attached to this root or None if it doesn’t exist.

Return type:

HiveInputLayer | None

guideLayer()

Returns the GuideLayer class instance from the meta node attached to this root.

Returns:

The GuideLayer attached to this root or None if it doesn’t exist.

Return type:

HiveGuideLayer | None

rigLayer()

Returns the RigLayer class instance from the meta node attached to this root.

Returns:

The RigLayer attached to this root or None if it doesn’t exist.

Return type:

HiveRigLayer | None

deformLayer()

Returns the DeformLayer class instance from the meta node attached to this root.

Returns:

The DeformLayer attached to this root or None if it doesn’t exist.

Return type:

HiveDeformLayer | None

geometryLayer()

Returns the GeometryLayer class instance from the meta node attached to this root.

Returns:

The GeometryLayer attached to this root or None if it doesn’t exist.

Return type:

HiveGeometryLayer | None

xGroupLayer()

Returns the XGroupLayer class instance from the meta node attached to this root.

Returns:

The XGroupLayer attached to this root or None if it doesn’t exist.

Return type:

HiveXGroupLayer | None

layers()

Returns a list of all layer instances attached to this component.

Searched layer types are:

  1. Guide Layer

  2. Output Layer

  3. Deform Layer

  4. Input Layer

  5. Rig Layer

  6. XGroup Layer

Returns:

A list of the existing layer instances.

Return type:

list[HiveLayer]

layerIdMapping()

Returns a dictionary mapping layer type constants to their corresponding layer instances.

This provides a convenient way to access all possible layer types for this component, with None values for any layers that haven’t been created yet.

Returns:

A dictionary with layer type constants as keys and layer instances as values.

Return type:

dict[str, HiveLayer | None]

layersById(layerIds)

Returns a dictionary of layerId: HiveLayer instance or None type.

This method is preferred when you need to retrieve multiple layers at a time over the individual layer methods.

Parameters:

layerIds (Iterable[str]) – Layer type ids to retrieve.

Returns:

The layer id mapped to the layer instance or None if it doesn’t exist.

Return type:

dict[str, HiveLayer | None]

layer(layerType)

Returns the layer attached to this root by type.

Parameters:

layerType (str) – The layer type constant ie. constants.GUIDE_LAYER_TYPE.

Returns:

The layer instance or None if it doesn’t exist.

Return type:

HiveLayer | None

createLayer(layerType, hrcName, metaName, parent=None)

Creates a new hive layer for specified type if it doesn’t already exist.

Parameters:
  • layerType (str) – The layer type constant ie. constants.GUIDE_LAYER_TYPE.

  • hrcName (str) – The new name for the layer Transform.

  • metaName (str) – The new name for the layer.

  • parent (DagNode | None) – The new parent for the root or None.

Returns:

The existing or newly created layer, None if the layer failed to be created.

Return type:

HiveLayer | None

addTaggedNode(node, tagId)

Adds a node to the component with a specific tag ID.

This method associates a node with a tag ID, allowing it to be easily retrieved later. If a node with the same tag ID already exists, it will be replaced.

Parameters:
  • node (DGNode) – The node to tag.

  • tagId (str) – The unique identifier for the tag.

taggedNode(tagId)

Retrieves a node by its tag ID.

Parameters:

tagId (str) – The unique identifier of the tag to search for.

Returns:

The tagged node if found, otherwise None.

Return type:

DGNode | None

taggedNodes()

Generator function which yields all nodes that have been tagged on this component.

Returns:

Each tagged node connected to this component.

Return type:

Iterator[DGNode]

findTaggedNodes(*tagIds)

Finds multiple tagged nodes by their tag IDs.

The returned list will contain the nodes in the same order as the input tag IDs, with None for any tags that weren’t found.

Parameters:

tagIds (str) – Variable number of tag IDs to search for.

Returns:

A list of nodes in the same order as the input tag IDs.

Return type:

list[DGNode | None]

class HiveRig(*args, **kwargs)

Bases: MetaBase

Hive rig meta node, the root of a Hive rig hierarchy.

Stores rig level metadata as node attributes ie. rig name, version info, selection sets, display layers and build script configuration.

id = 'HiveRig'
delete(mod=None, apply=True)

Deletes the rig meta node and its root transform hierarchy.

Parameters:
  • mod (Optional[om2.MDGModifier]) – Optional modifier to add the delete operation to.

  • apply (bool) – If True the modifier will be applied immediately.

displayLayer()

Get the display layer associated with this rig.

Returns:

The display layer node, or None if not set.

Return type:

DisplayLayer | None

createDisplayLayer(name)

Create a new display layer for this rig.

If a display layer already exists, it will be returned instead of creating a new one.

Parameters:

name (str) – The name to give the new display layer.

Returns:

The created or existing display layer.

Return type:

DisplayLayer

deleteControlDisplayLayer()

Deletes the primary control display layer for the rig instance.

Returns:

True if the display layer existed and was deleted.

Return type:

bool

rigName()

Returns the name for the rig via the “hName” attribute.

Returns:

The rig name.

Return type:

str

setBuildScriptConfig(configData)

Sets the build script configuration on the metaNode.

Note

Must be json compatible.

The configData is in the following form.

{
    "buildScriptId": {"propertyName": "propertyValue"}
}
Parameters:

configData (dict[str, dict]) – The configuration data for any/all buildscripts for the current rig.

buildScriptConfig()

Returns the build scripts configuration data.

See setBuildScriptConfig() for the structure of the data.

Returns:

The build script config dict containing the buildscript id and properties, an empty dict if the stored data can’t be decoded.

Return type:

dict[str, dict]

metaAttributes()

Returns a list of attribute definitions for the HiveRig meta node.

This method defines all the custom attributes that will be added to the meta node when it’s created. These attributes store various pieces of information about the rig, including version info, display layers, and selection sets.

Returns:

A list of attribute definitions in the format expected by the meta node system.

Return type:

list[dict]

selectionSets()

Returns the selection sets for this rig as a dict.

Returns:

A dict with the keys “ctrls”, “deform”, “root”, “geometry” and “blendshape” mapped to the selection set or None if it doesn’t exist.

Return type:

dict[str, ObjectSet | None]

selectionSet(nameId)

Retrieves a specific selection set by its meta attribute name.

Parameters:

nameId (str) – The meta attribute name of the selection set to retrieve ie. constants.CTRL_SELECTION_SET_ATTR.

Returns:

The requested selection set object, or None if not found.

Return type:

ObjectSet | None

rig = HiveRig()
ctrlSet = rig.selectionSet(constants.CTRL_SELECTION_SET_ATTR)
createSelectionSets(namingObject, createGeometrySelectionSet=False)

Creates any missing rig selection sets and connects them to the meta node.

The root selection set contains all other selection sets.

Parameters:
  • namingObject (naming.NameManager) – The naming configuration used to resolve the selection set names.

  • createGeometrySelectionSet (bool) – If True the geometry selection set will also be created.

Returns:

The same structure as selectionSets() including the newly created sets.

Return type:

dict[str, Optional[zapi.ObjectSet]]

componentLayer()

Returns the ComponentLayer class instance from the meta node attached to this root.

Returns:

The ComponentLayer attached to this root.

Return type:

HiveComponentLayer | None

geometryLayer()

Returns the GeometryLayer class instance from the meta node attached to this root.

Returns:

The GeometryLayer attached to this root.

Return type:

HiveGeometryLayer | None

deformLayer()

Returns the DeformLayer class instance from the meta node attached to this root.

Returns:

The DeformLayer attached to this root.

Return type:

HiveDeformLayer | None

rootTransform()

Returns the root transform node for this Rig.

Returns:

The root transform or None if not connected.

Return type:

DagNode | None

createTransform(name, parent)

Creates the rig root transform with locked and hidden transform attributes and connects it to the meta node.

Parameters:
  • name (str) – The name for the transform.

  • parent (DagNode | None) – The parent for the transform or None for the world.

Returns:

The newly created transform.

Return type:

DagNode

layers()

Returns the existing rig level layers.

Returns:

The geometry, deform and component layers which exist, in that order.

Return type:

list[HiveLayer]

layer(layerType)

Returns the layer attached to this root by type.

Parameters:

layerType (str) – The layer type constant ie. constants.DEFORM_LAYER_TYPE.

Returns:

The layer instance or None if it doesn’t exist.

Return type:

HiveLayer | None

createLayer(layerType, hrcName, metaName, parent=None)

Creates a new layer by type if it doesn’t already exist.

Parameters:
  • layerType (str) – The layer type constant ie. constants.DEFORM_LAYER_TYPE.

  • hrcName (str) – The new name for the layer transform.

  • metaName (str) – The new name for the meta Node.

  • parent (DagNode | None) – The new parent for the root or None.

Returns:

The existing or newly created layer, None if the layer failed to be created.

Return type:

HiveLayer | None

addExtraNodes(meta, extraNodes)

Adds a list of nodes to the layers meta node constants.EXTRANODES_ATTR.

Nodes which no longer exist in the scene are skipped.

Parameters:
  • meta (HiveLayer) – The Hive layer to add the metadata connections too, must have the “extraNodes” attribute.

  • extraNodes (Iterable[DGNode]) – A list of nodes to add to the meta node.

addTaggedNode(metaNode, node, tagId)

Adds a node to the metaNode with the given tagId.

If a node with the same tagId already exists, it will be replaced. If an empty slot is found (no connection), it will be used. Otherwise, a new element will be added to the array.

Parameters:
  • metaNode (MetaBase) – The meta node to add the tagged node to.

  • node (DGNode) – The node to tag.

  • tagId (str) – The unique identifier for the tag.

taggedNode(metaNode, tagId)

Retrieve a tagged node by its tag ID from the meta node.

Searches through the tagged nodes on the meta node and returns the first node that matches the given tag ID.

Parameters:
  • metaNode (MetaBase) – The meta node containing the tagged nodes.

  • tagId (str) – The unique identifier of the tag to search for.

Returns:

The tagged node if found, otherwise None.

Return type:

DGNode | None

taggedNodes(metaNode)

Generator function that yields all tagged nodes from the meta node.

Parameters:

metaNode (MetaBase) – The meta node to get tagged nodes from.

Returns:

Each tagged node connected to the meta node.

Return type:

Iterator[DGNode]

findTaggedNodes(metaNode, *tagIds)

Find multiple tagged nodes by their tag IDs.

Searches for nodes with the specified tag IDs and returns them in the same order as the input tag IDs. If a tag ID is not found, its position in the result list will be None.

Parameters:
  • metaNode (MetaBase) – The meta node containing the tagged nodes.

  • tagIds (str) – Variable number of tag IDs to search for.

Returns:

A list of nodes in the same order as the input tag IDs, with None for any not found.

Return type:

list[DGNode | None]