コード例 #1
0
ファイル: tabInfluenceList.py プロジェクト: seokkwan/Tapp
    def selectPaintWeightsInfluence(self,infl):
        '''
        tries to select influence (provided as string) in current maya's paint weights context and UI
        if skin paint context is not available, nothing happens
        '''
        if not Utils.isCurrentlyPaintingWeights():
            return
        
        # influence name can come in any form ('joint3', 'joint2|joint3', 'joint1|joint2|joint3')
        # get the absolute shortest possible (but still unique) and longest
        try:
            longName = cmds.ls(infl,l=True)[0]
            shortName = cmds.ls(longName,l=False)[0]

            log.info("selecting in paint weights: influence %s" % str(infl))
        
            # try to work around with the mess in the earlier versions of 
            # maya's paint weights UI:
            if Utils.getMayaVersion()<Utils.MAYA2011:
                itemName = Utils.mel('artAttrSkinShortName("%s")'%shortName)
                Utils.mel('artSkinSelectInfluence("artAttrSkinPaintCtx","%s","%s");' % (shortName,itemName));
            else:
                Utils.mel('artSkinSelectInfluence("artAttrSkinPaintCtx","%s");' % shortName);
                
            # show paint weights interface
            cmds.toolPropertyWindow()
        except:
            # problems listing given influence.. just die here
            Utils.displayError('problem selecting influence %s' % infl)
コード例 #2
0
    def selectPaintWeightsInfluence(self, infl):
        '''
        tries to select influence (provided as string) in current maya's paint weights context and UI
        if skin paint context is not available, nothing happens
        '''
        if not Utils.isCurrentlyPaintingWeights():
            return

        # influence name can come in any form ('joint3', 'joint2|joint3', 'joint1|joint2|joint3')
        # get the absolute shortest possible (but still unique) and longest
        try:
            longName = cmds.ls(infl, l=True)[0]
            shortName = cmds.ls(longName, l=False)[0]

            log.info("selecting in paint weights: influence %s" % str(infl))

            # try to work around with the mess in the earlier versions of
            # maya's paint weights UI:
            if Utils.getMayaVersion() < Utils.MAYA2011:
                itemName = Utils.mel('artAttrSkinShortName("%s")' % shortName)
                Utils.mel(
                    'artSkinSelectInfluence("artAttrSkinPaintCtx","%s","%s");'
                    % (shortName, itemName))
            else:
                Utils.mel(
                    'artSkinSelectInfluence("artAttrSkinPaintCtx","%s");' %
                    shortName)

            # show paint weights interface
            cmds.toolPropertyWindow()
        except:
            # problems listing given influence.. just die here
            Utils.displayError('problem selecting influence %s' % infl)
コード例 #3
0
ファイル: tabInfluenceList.py プロジェクト: seokkwan/Tapp
 def doInflListPaintWeights(self,*args):
     '''
     opens paint weights tool and paints on locally selected influence  
     '''
     if not Utils.isCurrentlyPaintingWeights():
         cmds.ArtPaintSkinWeightsTool()
         
     self.doInfluenceListItemSelected()
コード例 #4
0
    def doInflListPaintWeights(self, *args):
        '''
        opens paint weights tool and paints on locally selected influence  
        '''
        if not Utils.isCurrentlyPaintingWeights():
            cmds.ArtPaintSkinWeightsTool()

        self.doInfluenceListItemSelected()