def cleanupLinks(): """ Cleanup all nodes in the scene that have broken links """ nodes = meta.findMetaNodes(className=LINK_METACLASS) for node in nodes: if not getLink(node): unlink(node)
def getCollection(name): """ Return a QuickSelectCollection from the scene by name """ nodes = meta.findMetaNodes(META_CLASSNAME) for n in nodes: if getCollectionNameFromNode(n) == name: return QuickSelectCollection.fromNode(n)
def getAllCollections(): """ Return a list of all quick select collections """ nodes = meta.findMetaNodes(META_CLASSNAME) if nodes: return [QuickSelectCollection.fromNode(n) for n in nodes] # no sets, create the default one and return it in a list return [getDefaultCollection()]
def getNode(self): """ Return the collection node from the scene with the same name, if one exists """ nodes = meta.findMetaNodes(META_CLASSNAME) for n in nodes: if getCollectionNameFromNode(n) == self.name: return n
def test_findClassD(self): nodes = meta.findMetaNodes('ClassD') self.assertTrue(self.nodeA not in nodes) self.assertTrue(self.nodeB in nodes) self.assertTrue(self.nodeC in nodes)
def test_findClassA(self): nodes = meta.findMetaNodes('ClassA') self.assertTrue(self.nodeA in nodes) self.assertTrue(self.nodeB not in nodes) self.assertTrue(self.nodeC not in nodes)
def test_findAll(self): nodes = meta.findMetaNodes() self.assertTrue(self.nodeA in nodes) self.assertTrue(self.nodeB in nodes) self.assertTrue(self.nodeC in nodes)
def getAllSpaceConstraints(): """ Return a list of all space constrained nodes """ return meta.findMetaNodes(SPACECONSTRAINT_METACLASS)
def getAllSpaces(): """ Return a list of all space nodes """ return meta.findMetaNodes(SPACE_METACLASS)
def getAllRigs(): """ Return a list of all rigs in the scene """ return meta.findMetaNodes(RIG_METACLASS)
def getAllBlueprintNodes(): """ Return all nodes in the scene with Blueprint data """ return meta.findMetaNodes(BLUEPRINT_METACLASS)
def getAllMirrorNodes(): """ Return all nodes that have mirroring data """ return meta.findMetaNodes(MIRROR_METACLASS)
def getAllLinkedNodes(): """ Return all nodes in the scene that are linked """ return meta.findMetaNodes(className=LINK_METACLASS)
def getAllAnimControls(): """ Return all animation controls in the scene """ return meta.findMetaNodes('pulse_animcontrol')