def name_to_node(name): """Open Maya utility to convert a given node name to MObject""" selectionList = MSelectionList() selectionList.add(name) node = MObject() selectionList.getDependNode(0, node) return node
def getNodeFromName(in_name): selector = MSelectionList() MGlobal.getSelectionListByName(in_name, selector) node = MObject() selector.getDependNode(0, node) return node
def getDagPathFromName(in_name): selector = MSelectionList() MGlobal.getSelectionListByName(in_name, selector) path = MDagPath() selector.getDagPath(0, path) return path
def mayaNodeGetMat44(a): l = MSelectionList() MGlobal.getSelectionListByName(a, l) p = MDagPath() l.getDagPath(0, p) return mmatrixToMat44(p.inclusiveMatrix())