def getMeshFromSelection(): """""" try: node = cmds.ls(sl=1, ap=1)[0] dagPath = utils.getDagPath(node) if dagPath.hasFn(om.MFn.kMesh): return node else: om.MGlobal.displayError('"%s" isn\'t mesh type.' % node) except: return ""
def getMeshFromSelection(): """""" try: node = cmds.ls(sl=1, ap=1)[0] dagPath = utils.getDagPath(node) if dagPath.hasFn(om.MFn.kMesh): return node else: om.MGlobal.displayError("\"%s\" isn't mesh type." % node) except: return ""
def getLogicalInfluenceIndex(self,influence): """ Args: influence (str) Returns: int """ try: dagPath = utils.getDagPath(influence) except: raise utils.UserInputError("Could not find influence '%s' in %s" % (influence, self.skinCluster)) return self.fn.indexForInfluenceObject(dagPath)
def getInfluenceData(self, influence): """ Args: influence (str) Returns: WeightData """ try: dagPath = utils.getDagPath(influence) except: raise utils.UserInputError("Could not find influence '%s' in %s" % (influence, self.skinCluster)) selList = om.MSelectionList() weights = om.MDoubleArray() self.fn.getPointsAffectedByInfluence(dagPath, selList, weights) componentStr = [] selList.getSelectionStrings(componentStr) componentStr = cmds.ls(componentStr, ap=1, fl=1) weights = [w for w in weights] return WeightData(componentStr, weights)