# Path: src/pulse/scripts/pulse/rigs.py
# def isRig(node):
#     """
#     Return whether a node represents a pulse rig
# 
#     Args:
#         node: A PyNode or string node name
#     """
#     return meta.hasMetaClass(node, RIG_METACLASS)


import logging
import maya.OpenMaya as api
import maya.cmds as cmds
import pymel.core as pm
import pymetanode as meta
from functools import partial
from .rigs import isRig
        """
        # no way to know if it's a Rig yet,
        # defer until later and check the node again
        # TODO: do this more precisely, don't use deferred

        mfn = api.MFnDependencyNode(node)
        if mfn.typeName() != 'transform':
            # rig nodes must be transforms
            return

        fullName = api.MFnDagNode(node).fullPathName()
        cmds.evalDeferred(
            partial(self._onNodeAddedDeferred, fullName), evaluateNext=True)

    def _onNodeAddedDeferred(self, fullName, *args):
        """
        Args:
            fullName: A string full name of a node that was added
        """
        node = meta.getMObject(fullName)
        if node:
            if isRig(node):
                LOG.debug("onRigCreated('{0}')".format(node))
                self.onRigCreated(pm.PyNode(node))

    def _onNodeRemoved(self, node, *args):
        """
        Args:
            node: A MObject node that is being removed
        """

# Path: src/pulse/scripts/pulse/rigs.py
# def isRig(node):
#     """
#     Return whether a node represents a pulse rig
# 
#     Args:
#         node: A PyNode or string node name
#     """
#     return meta.hasMetaClass(node, RIG_METACLASS)


# Path: src/pulse/scripts/pulse/events.py
import logging
import maya.OpenMaya as api
import maya.cmds as cmds
import pymel.core as pm
import pymetanode as meta
from functools import partial
from .rigs import isRig

        """
        # no way to know if it's a Rig yet,
        # defer until later and check the node again
        # TODO: do this more precisely, don't use deferred

        mfn = api.MFnDependencyNode(node)
        if mfn.typeName() != 'transform':
            # rig nodes must be transforms
            return

        fullName = api.MFnDagNode(node).fullPathName()
        cmds.evalDeferred(
            partial(self._onNodeAddedDeferred, fullName), evaluateNext=True)

    def _onNodeAddedDeferred(self, fullName, *args):
        """
        Args:
            fullName: A string full name of a node that was added
        """
        node = meta.getMObject(fullName)
        if node:
            if isRig(node):
                LOG.debug("onRigCreated('{0}')".format(node))
                self.onRigCreated(pm.PyNode(node))

    def _onNodeRemoved(self, node, *args):
        """
        Args:
            node: A MObject node that is being removed
        """

        if isRig(node):