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 ""
Пример #2
0
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 ""
Пример #3
0
    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)
Пример #4
0
    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)