示例#1
0
def validateMirrorNode(node):
    """
    Ensure the node still has a valid mirroring counterpart.
    If it does not, remove the mirror data from the node.

    Return:
        True if the node is a valid mirror node
    """
    if not isMirrorNode(node):
        return False
    data = meta.getMetaData(node, MIRROR_METACLASS)
    otherNode = data['otherNode']
    if otherNode is None:
        LOG.debug("{0} paired node not found, "
                  "removing mirroring data".format(node))
        meta.removeMetaData(node, MIRROR_METACLASS)
        return False
    else:
        othersOther = getPairedNode(otherNode, False)
        if othersOther != node:
            LOG.debug("{0} pairing is unreciprocated, "
                      "removing mirror data".format(node))
            meta.removeMetaData(node, MIRROR_METACLASS)
            return False
    return True
示例#2
0
def removeMirroringData(node):
    """
    Remove mirroring data from a node. This does NOT
    remove mirroring data from the other node, if there
    is one. See `unpairMirrorNode` for removing mirroring
    data from two nodes at once.

    Args:
        node: A PyNode, MObject, or node name
    """
    meta.removeMetaData(node, MIRROR_METACLASS)
示例#3
0
 def test_removeLockedData(self):
     meta.setMetaData(self.node, 'myMetaClass', 'myTestData')
     self.node.attr(meta.core.METADATA_ATTR).setLocked(True)
     result = meta.removeMetaData(self.node)
     self.assertFalse(result)
     data = meta.getMetaData(self.node)
     self.assertEqual(data, {'myMetaClass': 'myTestData'})
示例#4
0
 def test_removeClassData(self):
     meta.setMetaData(self.node, 'myMetaClass', None)
     meta.setMetaData(self.node, 'mySecondMetaClass', None)
     result = meta.removeMetaData(self.node, 'myMetaClass')
     self.assertTrue(result)
     self.assertTrue(meta.isMetaNode(self.node))
     self.assertFalse(meta.hasMetaClass(self.node, 'myMetaClass'))
     self.assertTrue(meta.hasMetaClass(self.node, 'mySecondMetaClass'))
示例#5
0
 def test_removeData(self):
     meta.setMetaData(self.node, 'myMetaClass', None)
     self.assertTrue(meta.isMetaNode(self.node))
     result = meta.removeMetaData(self.node)
     self.assertTrue(result)
     self.assertFalse(meta.isMetaNode(self.node))
示例#6
0
文件: links.py 项目: qeeji/maya-pulse
def unlink(node):
    """
    Remove a link from a node
    """
    meta.removeMetaData(node, className=LINK_METACLASS)
示例#7
0
def unlink(node):
    """
    Remove a link from a node
    """
    meta.removeMetaData(node, className=LINK_METACLASS)
    LOG.info("Unlinked %s", node)