本文整理汇总了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"]+"\";")
示例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)]
示例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#スキップしない
示例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')
#選択セットのノード、コンポーネントを削除
示例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')
示例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
示例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')
示例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
示例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
示例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
示例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()
示例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
示例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()
示例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!")
示例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!")