當前位置: 首頁>>代碼示例>>Python>>正文


Python Utils.refreshPaintWeightsTool方法代碼示例

本文整理匯總了Python中ngSkinTools.utils.Utils.refreshPaintWeightsTool方法的典型用法代碼示例。如果您正苦於以下問題:Python Utils.refreshPaintWeightsTool方法的具體用法?Python Utils.refreshPaintWeightsTool怎麽用?Python Utils.refreshPaintWeightsTool使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ngSkinTools.utils.Utils的用法示例。


在下文中一共展示了Utils.refreshPaintWeightsTool方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: execRelax

# 需要導入模塊: from ngSkinTools.utils import Utils [as 別名]
# 或者: from ngSkinTools.utils.Utils import refreshPaintWeightsTool [as 別名]
    def execRelax(self,*args):
        '''
            relax button click handler. this is where it actually 
            executes skin relax, whoop-tee-doo.
        '''
        try:

            args = {}
            args['numSteps']=self.controls.numSteps.getValue()
            args['stepSize']=self.controls.stepSize.getValue()
            
            # do we need soft selection?
            self.controls.softSelection.addToArgs(args)
            
                
            # do we need volume association?
            if self.controls.useVolumeAssociation.getValue():
                args['abv']=1
                args['avr']=self.controls.volumeAssociationRadius.getValue()

            # add selection+highlight as arguments
            # we need highlight as second argument because
            # other meshes for simulation might be included only through highlight.
            #
            # This will never be an empty list as we tested for vertex selection available earlier
            def makeList(listOrNull):
                if listOrNull is None:
                    return []
                return listOrNull
            
            objects = makeList(cmds.ls(sl=True))+makeList(cmds.ls(hl=True))
            
            if len(objects)==0:
                raise MessageException("Nothing is selected")
            
            # execute stuff  
            try:
                cmds.waitCursor(state=True)
                cmds.ngSkinRelax(objects,**args)
            finally:
                cmds.waitCursor(state=False)
                
            Utils.refreshPaintWeightsTool()
            
        except MessageException,err:
            raise err
開發者ID:leandropim,項目名稱:Tapp,代碼行數:48,代碼來源:tabSkinRelax.py


注:本文中的ngSkinTools.utils.Utils.refreshPaintWeightsTool方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。