当前位置: 首页>>代码示例>>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;未经允许,请勿转载。