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


Python cmds.confirmDialog方法代碼示例

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


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

示例1: dpMain

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import confirmDialog [as 別名]
def dpMain(self, *args):
        """ Main function.
            Check existen nodes and call the scripted function.
        """
        callAction = False
        self.allGrp = self.dpFindAllGrpBySelection()
        if self.allGrp:
            callAction = True
        else:
            allGrpList = self.dpCountAllGrp()
            if allGrpList:
                if len(allGrpList) > 1:
                    self.allGrp = cmds.confirmDialog(title=self.langDic[self.langName]["m166_selAllControls"], message=self.langDic[self.langName]["m168_wichAllGrp"], button=allGrpList)
                else:
                    self.allGrp = self.dpCheckAllGrp(self.allGrp)
                if self.allGrp:
                    callAction = True
                else:
                    self.allGrp = self.dpFindAllGrp()
                    if self.allGrp:
                        callAction = True
        if callAction:
            self.dpSelectAllCtrls(self.allGrp)
        else:
            mel.eval("warning \""+self.langDic[self.langName]["e019_notFoundAllGrp"]+"\";") 
開發者ID:nilouco,項目名稱:dpAutoRigSystem,代碼行數:27,代碼來源:dpSelectAllControls.py

示例2: ajustSelection

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import confirmDialog [as 別名]
def ajustSelection(self):
        #選択したものからメッシュノードがあるものを取り出し。
        #何も選択されていなかったらシーン內のメッシュ全取得
        selection = cmds.ls(sl=True)
        #print len(selection)
        #print selection
        if self.popUpMsg:
            if len(selection) == 0:
                allMeshSel = cmds.confirmDialog(m=self.msg01, t='', b= [self.msg02, self.msg03], db=self.msg02, cb=self.msg03, icn='question',ds=self.msg03)
                #print allMeshSel
                if allMeshSel == self.msg02:
                    selection = cmds.ls(type='transform')
        else:
            if len(selection) == 0:
                #print 'process all of mesh'
                selection = cmds.ls(type='transform')
        #メッシュノードが存在したらリストに加える
        return [sel for sel in selection if common.search_polygon_mesh(sel)] 
開發者ID:ShikouYamaue,項目名稱:SISideBar,代碼行數:20,代碼來源:uv.py

示例3: checkCurrentUV

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import confirmDialog [as 別名]
def checkCurrentUV(self):
        if self.force:
            return True
        if cmds.polyEvaluate(self.mesh, uv=True, uvs=self.currentSet[0]) == 0:
            msg04 = lang.Lang(
                en=str(self.mesh)+' : Current UVSet ['+str(self.currentSet[0])+'] is empty.\nDo you skip this mesh?',
                ja=self.mesh+u' : 現在のUVSet ['+self.currentSet[0]+u'] が空です。\nこのメッシュをスキップしますか?'
            )   
            self.msg04 = msg04.output()
            self.skipMesh = cmds.confirmDialog(m=self.msg04, t='', b= [self.msg02, self.msg03], db=self.msg02, cb=self.msg03, icn='question',ds=self.msg03)
        else:
            return True#スキップしない
        if self.skipMesh == self.msg02:
            return False#スキップする
        else:
            return True#スキップしない 
開發者ID:ShikouYamaue,項目名稱:SISideBar,代碼行數:18,代碼來源:uv.py

示例4: add_to_set_members

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import confirmDialog [as 別名]
def add_to_set_members():
    selection = cmds.ls(sl=True)
    
    if selection:
        setCount = 0
        for node in selection:
            if cmds.nodeType(node) != 'objectSet':
                continue
            for sel in selection:
                if sel == node:
                    continue
                try:
                    cmds.sets(sel, add=node)
                except Exception as e:
                    print e.message
            setCount += 1
        if setCount == 0:
            cmds.confirmDialog( title='Error',message='Please select set_node')

#選択セットのノード、コンポーネントを削除 
開發者ID:ShikouYamaue,項目名稱:SISideBar,代碼行數:22,代碼來源:sets.py

示例5: remove_set_members

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import confirmDialog [as 別名]
def remove_set_members():
    selection = cmds.ls(sl=True)
    if selection:
        setCount = 0
        for node in selection:
            if cmds.nodeType(node) != 'objectSet':
                continue
            setMembers = cmds.sets(node, int=node)
            for removeNode in selection:
                if removeNode == node:
                    continue
                try:
                    print 'Remove from set :', node, ': Object :', removeNode
                    cmds.sets(removeNode, rm=node)
                except:
                    pass
            setCount += 1
        if setCount == 0:
            cmds.confirmDialog( title='Error',message='Please select set_node') 
開發者ID:ShikouYamaue,項目名稱:SISideBar,代碼行數:21,代碼來源:sets.py

示例6: upToDateCheck

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import confirmDialog [as 別名]
def upToDateCheck(revision, prompt=True):
    '''
    This is a check that can be run by scripts that import ml_utilities to make sure they
    have the correct version.
    '''

    if not '__revision__' in locals():
        return

    if revision > __revision__:
        if prompt and mc.optionVar(query='ml_utilities_revision') < revision:
            result = mc.confirmDialog( title='Module Out of Date',
                                       message='Your version of ml_utilities may be out of date for this tool. Without the latest file you may encounter errors.',
                                       button=['Download Latest Revision','Ignore', "Don't Ask Again"],
                                       defaultButton='Download Latest Revision', cancelButton='Ignore', dismissString='Ignore' )

            if result == 'Download Latest Revision':
                mc.showHelp(GITHUB_ROOT_URL+'ml_utilities.py', absolute=True)
            elif result == "Don't Ask Again":
                mc.optionVar(intValue=('ml_utilities_revision', revision))
        return False
    return True 
開發者ID:morganloomis,項目名稱:ml_tools,代碼行數:24,代碼來源:ml_utilities.py

示例7: about

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import confirmDialog [as 別名]
def about(self, *args):
        '''
        This pops up a window which shows the revision number of the current script.
        '''

        text='by Morgan Loomis\n\n'
        try:
            __import__(self.module)
            module = sys.modules[self.module]
            text = text+'Revision: '+str(module.__revision__)+'\n'
        except StandardError:
            pass
        try:
            text = text+'ml_utilities Rev: '+str(__revision__)+'\n'
        except StandardError:
            pass

        mc.confirmDialog(title=self.name, message=text, button='Close') 
開發者ID:morganloomis,項目名稱:ml_tools,代碼行數:20,代碼來源:ml_utilities.py

示例8: stock_copy_mesh

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import confirmDialog [as 別名]
def stock_copy_mesh(self):
        hl_node = cmds.ls(hl=True, l=True)
        sel_node = cmds.ls(sl=True, l=True)
        temp_copy_mesh = common.search_polygon_mesh(hl_node+sel_node, fullPath=True)
        self.copy_mesh = []
        for node in temp_copy_mesh:
            skin_cluster = cmds.ls(cmds.listHistory(node), type='skinCluster')
            if skin_cluster:
                self.copy_mesh.append(node)
        
        if not self.copy_mesh:
            cmds.confirmDialog( title='Error',
                  message= self.msg02)
            return self.msg02
        return 'Set Copy Mesh :\n'+str(self.copy_mesh)
        #print 'copy mesh :',self.copy_mesh 
開發者ID:ShikouYamaue,項目名稱:SIWeightEditor,代碼行數:18,代碼來源:weight_transfer_multiple.py

示例9: getUserDetail

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import confirmDialog [as 別名]
def getUserDetail(opt1, opt2, cancel, userMessage):
    """ Ask user the detail level we'll create the guides by a confirm dialog box window.
        Options:
            Simple
            Complete
        Returns the user choose option or None if canceled.
    """
    result = cmds.confirmDialog(title=CLASS_NAME, message=userMessage, button=[opt1, opt2, cancel], defaultButton=opt2, cancelButton=cancel, dismissString=cancel)
    return result 
開發者ID:nilouco,項目名稱:dpAutoRigSystem,代碼行數:11,代碼來源:dpBiped.py

示例10: getUserDetail

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import confirmDialog [as 別名]
def getUserDetail(opt1, opt2, cancel, default, userMessage):
    """ Ask user the detail level we'll create the guides by a confirm dialog box window.
        Options:
            Simple
            Complete
        Returns the user choose option or None if canceled.
    """
    result = cmds.confirmDialog(title=CLASS_NAME, message=userMessage, button=[opt1, opt2, cancel], defaultButton=default, cancelButton=cancel, dismissString=cancel)
    return result 
開發者ID:nilouco,項目名稱:dpAutoRigSystem,代碼行數:11,代碼來源:dpTweaks.py

示例11: dpTranslatorMain

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import confirmDialog [as 別名]
def dpTranslatorMain(self, *args):
        """ Open a serie of dialog boxes to get user input to mount a new language json dictionary.
            We show a window to translate step by step.
        """
        # give info:
        greetingsDialog = cmds.confirmDialog(
                                            title=self.langDic[self.langName]['t000_translator'],
                                            message=self.langDic[self.langName]['t001_greeting'],
                                            button=[self.langDic[self.langName]['i131_ok'], self.langDic[self.langName]['i132_cancel']],
                                            defaultButton=self.langDic[self.langName]['i131_ok'],
                                            cancelButton=self.langDic[self.langName]['i132_cancel'],
                                            dismissString=self.langDic[self.langName]['i132_cancel'])
        if greetingsDialog == self.langDic[self.langName]['i131_ok']:
            self.dpGetUserInfoUI() 
開發者ID:nilouco,項目名稱:dpAutoRigSystem,代碼行數:16,代碼來源:dpTranslator.py

示例12: dpCheckGeometry

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import confirmDialog [as 別名]
def dpCheckGeometry(self, item, *args):
        isGeometry = False
        if item:
            if cmds.objExists(item):
                childList = cmds.listRelatives(item, children=True)
                if childList:
                    try:
                        itemType = cmds.objectType(childList[0])
                        if itemType == "mesh" or itemType == "nurbsSurface" or itemType == "subdiv":
                            if cmds.checkBox(self.checkHistoryCB, query=True, value=True):
                                historyList = cmds.listHistory(childList[0])
                                if len(historyList) > 1:
                                    dialogReturn = cmds.confirmDialog(title=self.langDic[self.langName]["i159_historyFound"], message=self.langDic[self.langName]["i160_historyDesc"]+"\n\n"+item+"\n\n"+self.langDic[self.langName]["i161_historyMessage"], button=['Yes','No'], defaultButton='Yes', cancelButton='No', dismissString='No')
                                    if dialogReturn == "Yes":
                                        isGeometry = True
                                else:
                                    isGeometry = True
                            else:
                                isGeometry = True
                        else:
                            mel.eval("warning \""+item+" "+self.langDic[self.langName]["i058_notGeo"]+"\";")
                    except:
                        mel.eval("warning \""+self.langDic[self.langName]["i163_sameName"]+" "+item+"\";")
                else:
                    mel.eval("warning \""+self.langDic[self.langName]["i059_selTransform"]+" "+item+" "+self.langDic[self.langName]["i060_shapePlease"]+"\";")
            else:
                mel.eval("warning \""+item+" "+self.langDic[self.langName]["i061_notExists"]+"\";")
        else:
            mel.eval("warning \""+self.langDic[self.langName]["i062_notFound"]+" "+item+"\";")
        return isGeometry 
開發者ID:nilouco,項目名稱:dpAutoRigSystem,代碼行數:32,代碼來源:dpTargetMirror.py

示例13: playblast_dialog

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import confirmDialog [as 別名]
def playblast_dialog():
  # Creates a dialog prompt to determine if the user wishes to create a playblast
  #response = cmds.confirmDialog( title='Playblast', message='Are you SURE you want to create a new playblast?', button=['Yes','No'], defaultButton='No', cancelButton='No', dismissString='No' )
  #if response == 'Yes':
  floatUI() 
開發者ID:Clemson-DPA,項目名稱:dpa-pipe,代碼行數:7,代碼來源:playblast.py

示例14: about

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import confirmDialog [as 別名]
def about(*_, **__):
    print cmds.confirmDialog(title='mGui', message="This is function was loaded from a yaml file", button="Wow!") 
開發者ID:theodox,項目名稱:mGui,代碼行數:4,代碼來源:menu_loader.py

示例15: regular

# 需要導入模塊: from maya import cmds [as 別名]
# 或者: from maya.cmds import confirmDialog [as 別名]
def regular(*_, **__):
    print cmds.confirmDialog(title='mGui', message="Menus commands can be loaded as fully qualified path names, "
                                                   "like <b>mGui.examples.menu_loader.regular</b>", button="Cool!") 
開發者ID:theodox,項目名稱:mGui,代碼行數:5,代碼來源:menu_loader.py


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