本文整理汇总了Python中maya.cmds.showWindow方法的典型用法代码示例。如果您正苦于以下问题:Python cmds.showWindow方法的具体用法?Python cmds.showWindow怎么用?Python cmds.showWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类maya.cmds
的用法示例。
在下文中一共展示了cmds.showWindow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: info
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import showWindow [as 别名]
def info(self, title, description, text, align, width, height, *args):
""" Create a window showing the text info with the description about any module.
"""
# declaring variables:
self.info_title = title
self.info_description = description
self.info_text = text
self.info_winWidth = width
self.info_winHeight = height
self.info_align = align
# creating Info Window:
if cmds.window('dpInfoWindow', query=True, exists=True):
cmds.deleteUI('dpInfoWindow', window=True)
dpInfoWin = cmds.window('dpInfoWindow', title='dpAutoRig - v'+DPAR_VERSION+' - '+self.langDic[self.langName]['i013_info']+' - '+self.langDic[self.langName][self.info_title], iconName='dpInfo', widthHeight=(self.info_winWidth, self.info_winHeight), menuBar=False, sizeable=True, minimizeButton=False, maximizeButton=False)
# creating text layout:
infoColumnLayout = cmds.columnLayout('infoColumnLayout', adjustableColumn=True, columnOffset=['both', 20], parent=dpInfoWin)
cmds.separator(style='none', height=10, parent=infoColumnLayout)
infoLayout = cmds.scrollLayout('infoLayout', parent=infoColumnLayout)
if self.info_description:
infoDesc = cmds.text(self.langDic[self.langName][self.info_description], align=self.info_align, parent=infoLayout)
if self.info_text:
infoText = cmds.text(self.info_text, align=self.info_align, parent=infoLayout)
# call Info Window:
cmds.showWindow(dpInfoWin)
示例2: donateWin
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import showWindow [as 别名]
def donateWin(self, *args):
""" Simple window with links to donate in order to support this free and openSource code via PayPal.
"""
# declaring variables:
self.donate_title = 'dpAutoRig - v'+DPAR_VERSION+' - '+self.langDic[self.langName]['i167_donate']
self.donate_description = self.langDic[self.langName]['i168_donateDesc']
self.donate_winWidth = 305
self.donate_winHeight = 300
self.donate_align = "center"
# creating Donate Window:
if cmds.window('dpDonateWindow', query=True, exists=True):
cmds.deleteUI('dpDonateWindow', window=True)
dpDonateWin = cmds.window('dpDonateWindow', title=self.donate_title, iconName='dpInfo', widthHeight=(self.donate_winWidth, self.donate_winHeight), menuBar=False, sizeable=True, minimizeButton=False, maximizeButton=False)
# creating text layout:
donateColumnLayout = cmds.columnLayout('donateColumnLayout', adjustableColumn=True, columnOffset=['both', 20], rowSpacing=5, parent=dpDonateWin)
cmds.separator(style='none', height=10, parent=donateColumnLayout)
infoDesc = cmds.text(self.donate_description, align=self.donate_align, parent=donateColumnLayout)
cmds.separator(style='none', height=10, parent=donateColumnLayout)
brPaypalButton = cmds.button('brlPaypalButton', label=self.langDic[self.langName]['i167_donate']+" - R$ - Real", align=self.donate_align, command=partial(utils.visitWebSite, DONATE+"BRL"), parent=donateColumnLayout)
#usdPaypalButton = cmds.button('usdPaypalButton', label=self.langDic[self.langName]['i167_donate']+" - USD - Dollar", align=self.donate_align, command=partial(utils.visitWebSite, DONATE+"USD"), parent=donateColumnLayout)
# call Donate Window:
cmds.showWindow(dpDonateWin)
示例3: dpIkFkSnapUI
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import showWindow [as 别名]
def dpIkFkSnapUI(self, *args):
""" Show a little window with buttons to change from Ik to Fk or from Fk to Ik snapping.
"""
# creating ikFkSnap Window:
if cmds.window('dpIkFkSnapWindow', query=True, exists=True):
cmds.deleteUI('dpIkFkSnapWindow', window=True)
ikFkSnap_winWidth = 205
ikFkSnap_winHeight = 50
dpIkFkSnapWin = cmds.window('dpIkFkSnapWindow', title='IkFkSnap '+DPIKFK_VERSION, iconName='dpIkFkSnap', widthHeight=(ikFkSnap_winWidth, ikFkSnap_winHeight), menuBar=False, sizeable=True, minimizeButton=True, maximizeButton=False, menuBarVisible=False, titleBar=True)
# creating layout:
ikFkSnapLayout = cmds.columnLayout('ikFkSnapLayout', adjustableColumn=True, parent=dpIkFkSnapWin)
# creating buttons:
cmds.button('ikToFkSnap_BT', label="Ik --> Fk", backgroundColor=(0.8, 0.8, 1.0), command=self.IkToFkSnap, parent=ikFkSnapLayout)
cmds.button('fkToIkSnap_BT', label="Fk --> Ik", backgroundColor=(1.0, 0.8, 0.8), command=self.FkToIkSnap, parent=ikFkSnapLayout)
# call colorIndex Window:
cmds.showWindow(dpIkFkSnapWin)
示例4: dpReorderAttrUI
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import showWindow [as 别名]
def dpReorderAttrUI(self, *args):
""" Create a window in order to load the original model and targets to be mirrored.
"""
# creating dpReorderAttrUI Window:
self.dpCloseReorderAttrUI()
reorderAttr_winWidth = 175
reorderAttr_winHeight = 75
dpReorderAttrWin = cmds.window('dpReorderAttrWindow', title=self.langDic[self.langName]["m087_reorderAttr"]+" "+DPRA_VERSION, widthHeight=(reorderAttr_winWidth, reorderAttr_winHeight), menuBar=False, sizeable=True, minimizeButton=False, maximizeButton=False, menuBarVisible=False, titleBar=True)
# creating layout:
reorderAttrLayout = cmds.columnLayout('reorderAttrLayout', columnOffset=("left", 30))
cmds.separator(style='none', height=7, parent=reorderAttrLayout)
cmds.button(label=self.langDic[self.langName]["i154_up"], annotation=self.langDic[self.langName]["i155_upDesc"], width=110, backgroundColor=(0.45, 1.0, 0.6), command=partial(self.dpMoveAttr, 1, None, None, True), parent=reorderAttrLayout)
cmds.separator(style='in', height=10, width=110, parent=reorderAttrLayout)
cmds.button(label=self.langDic[self.langName]["i156_down"], annotation=self.langDic[self.langName]["i157_downDesc"], width=110, backgroundColor=(1.0, 0.45, 0.45), command=partial(self.dpMoveAttr, 0, None, None, True), parent=reorderAttrLayout)
# call dpReorderAttrUI Window:
cmds.showWindow(dpReorderAttrWin)
示例5: colorizeModuleUI
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import showWindow [as 别名]
def colorizeModuleUI(self, colorIndex, *args):
""" Show a little window to choose the color of the button and the override the guide.
"""
# verify integrity of the guideModule:
if self.verifyGuideModuleIntegrity():
# creating colorIndex Window:
if cmds.window('dpColorIndexWindow', query=True, exists=True):
cmds.deleteUI('dpColorIndexWindow', window=True)
colorIndex_winWidth = 160
colorIndex_winHeight = 80
self.dpColorIndexWin = cmds.window('dpColorIndexWindow', title='Color Index', iconName='dpColorIndex', widthHeight=(colorIndex_winWidth, colorIndex_winHeight), menuBar=False, sizeable=False, minimizeButton=False, maximizeButton=False, menuBarVisible=False, titleBar=True)
# creating layout:
colorIndexLayout = cmds.gridLayout('colorIndexLayout', numberOfColumns=8, cellWidthHeight=(20,20))
# creating buttons:
for colorIndex, colorValues in enumerate(self.colorList):
cmds.button('indexColor_'+str(colorIndex)+'_BT', label=str(colorIndex), backgroundColor=(colorValues[0], colorValues[1], colorValues[2]), command=partial(self.setColorModule, colorIndex), parent=colorIndexLayout)
# call colorIndex Window:
cmds.showWindow(self.dpColorIndexWin)
示例6: createSpiralWin
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import showWindow [as 别名]
def createSpiralWin():
window = cmds.window( title="Create Spiral", widthHeight=(200, 300) )
cmds.columnLayout( columnAttach=('both', 5), rowSpacing=5, adjustableColumn=True )
amp = cmds.floatFieldGrp( numberOfFields=1, label='Amp', value1=1.0)
spin = cmds.floatFieldGrp( numberOfFields=1, label='Spin', value1=30)
count = cmds.intFieldGrp( numberOfFields=1, label='Count', value1=20)
width = cmds.floatFieldGrp( numberOfFields=1, label='Width', value1=3)
def click(value):
doCreateSpiral(amp, spin, count, width)
cmds.button( label='Create Spiral!', command=click )
closeCmd = 'cmds.deleteUI("%s", window=True)' % window
cmds.button( label='Close', command=closeCmd )
cmds.showWindow( window )
示例7: quickBreakDownUI
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import showWindow [as 别名]
def quickBreakDownUI():
winName = 'ml_quickBreakdownWin'
if mc.window(winName, exists=True):
mc.deleteUI(winName)
mc.window(winName, title='ml :: QBD', iconName='Quick Breakdown', width=100, height=500)
mc.columnLayout(adj=True)
mc.paneLayout(configuration='vertical2', separatorThickness=1)
mc.text('<<')
mc.text('>>')
mc.setParent('..')
for v in (10,20,50,80,90,100,110,120,150):
mc.paneLayout(configuration='vertical2',separatorThickness=1)
mc.button(label=str(v)+' %', command=partial(weightPrevious,v/100.0))
mc.button(label=str(v)+' %', command=partial(weightNext,v/100.0))
mc.setParent('..')
mc.showWindow(winName)
mc.window(winName, edit=True, width=100, height=250)
示例8: finish
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import showWindow [as 别名]
def finish(self):
'''
Finalize the UI
'''
mc.setParent(self.form)
frame = mc.frameLayout(labelVisible=False)
mc.helpLine()
mc.formLayout( self.form, edit=True,
attachForm=((self.column, 'top', 0), (self.column, 'left', 0),
(self.column, 'right', 0), (frame, 'left', 0),
(frame, 'bottom', 0), (frame, 'right', 0)),
attachNone=((self.column, 'bottom'), (frame, 'top')) )
mc.showWindow(self.name)
mc.window(self.name, edit=True, width=self.width, height=self.height)
示例9: mini
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import showWindow [as 别名]
def mini():
name = 'ml_arcTracer_win_mini'
w = 100
h = 50
if mc.window(name, exists=True):
mc.deleteUI(name)
win = mc.window(name, width=w, height=h, title='arcs', iconName='arc')
form = mc.formLayout()
a1 = mc.button(label='camera', command=traceCamera)
a2 = mc.button(label='world', command=traceWorld)
b1 = mc.button(label='retrace', command=retraceArc)
b2 = mc.button(label='clear', command=clearArcs)
utl.formLayoutGrid(form, [[a1,a2],[b1,b2]], )
mc.showWindow(win)
mc.window(win, edit=True, width=w, height=h)
示例10: dpARLoadingWindow
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import showWindow [as 别名]
def dpARLoadingWindow():
""" Just create a Loading window in order to show we are working to user when calling dpAutoRigSystem.
"""
loadingString = "Loading dpAutoRigSystem v%s ... " %DPAR_VERSION
print loadingString,
path = os.path.dirname(__file__)
randImage = random.randint(0,7)
clearDPARLoadingWindow()
cmds.window('dpARLoadWin', title='dpAutoRigSystem', iconName='dpAutoRig', widthHeight=(285, 203), menuBar=False, sizeable=False, minimizeButton=False, maximizeButton=False)
cmds.columnLayout('dpARLoadLayout')
cmds.image('loadingImage', image=(path+"/Icons/dp_loading_0%i.png" %randImage), backgroundColor=(0.8, 0.8, 0.8), parent='dpARLoadLayout')
cmds.text('versionText', label=loadingString, parent='dpARLoadLayout')
cmds.showWindow('dpARLoadWin')
示例11: updateWin
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import showWindow [as 别名]
def updateWin(self, rawResult, text, *args):
""" Create a window showing the text info with the description about any module.
"""
# declaring variables:
self.update_checkedNumber = rawResult[0]
self.update_remoteVersion = rawResult[1]
self.update_remoteLog = rawResult[2]
self.update_text = text
self.update_winWidth = 305
self.update_winHeight = 300
# creating Update Window:
if cmds.window('dpUpdateWindow', query=True, exists=True):
cmds.deleteUI('dpUpdateWindow', window=True)
dpUpdateWin = cmds.window('dpUpdateWindow', title='dpAutoRigSystem - '+self.langDic[self.langName]['i089_update'], iconName='dpInfo', widthHeight=(self.update_winWidth, self.update_winHeight), menuBar=False, sizeable=True, minimizeButton=False, maximizeButton=False)
# creating text layout:
updateLayout = cmds.columnLayout('updateLayout', adjustableColumn=True, columnOffset=['both', 20], rowSpacing=5, parent=dpUpdateWin)
if self.update_text:
updateDesc = cmds.text("\n"+self.langDic[self.langName][self.update_text], align="center", parent=updateLayout)
cmds.text("\n"+DPAR_VERSION+self.langDic[self.langName]['i090_currentVersion'], align="left", parent=updateLayout)
if self.update_remoteVersion:
cmds.text(self.update_remoteVersion+self.langDic[self.langName]['i091_onlineVersion'], align="left", parent=updateLayout)
cmds.separator(height=30)
if self.update_remoteLog:
remoteLog = self.update_remoteLog.replace("\\n", "\n")
cmds.text(self.langDic[self.langName]['i171_updateLog']+":\n", align="center", parent=updateLayout)
cmds.text(remoteLog, align="left", parent=updateLayout)
cmds.separator(height=30)
whatsChangedButton = cmds.button('whatsChangedButton', label=self.langDic[self.langName]['i117_whatsChanged'], align="center", command=partial(utils.visitWebSite, DPAR_WHATSCHANGED), parent=updateLayout)
visiteGitHubButton = cmds.button('visiteGitHubButton', label=self.langDic[self.langName]['i093_gotoWebSite'], align="center", command=partial(utils.visitWebSite, DPAR_GITHUB), parent=updateLayout)
if (int(cmds.about(version=True)[:4]) < 2019) and platform.system() == "Darwin": #Maya 2018 or older on macOS
upgradeSSLmacOSButton = cmds.button('upgradeSSLmacOSButton', label=self.langDic[self.langName]['i164_sslMacOS'], align="center", backgroundColor=(0.8, 0.4, 0.4), command=partial(utils.visitWebSite, SSL_MACOS), parent=updateLayout)
downloadButton = cmds.button('downloadButton', label=self.langDic[self.langName]['i094_downloadUpdate'], align="center", command=partial(self.downloadUpdate, DPAR_MASTERURL, "zip"), parent=updateLayout)
installButton = cmds.button('installButton', label=self.langDic[self.langName]['i095_installUpdate'], align="center", command=partial(self.installUpdate, DPAR_MASTERURL, self.update_remoteVersion), parent=updateLayout)
# automatically check for updates:
cmds.separator(height=30)
self.autoCheckUpdateCB = cmds.checkBox('autoCheckUpdateCB', label=self.langDic[self.langName]['i092_autoCheckUpdate'], align="left", value=self.userDefAutoCheckUpdate, changeCommand=self.setAutoCheckUpdatePref, parent=updateLayout)
cmds.separator(height=30)
# call Update Window:
cmds.showWindow(dpUpdateWin)
print self.langDic[self.langName][self.update_text]
示例12: dpGetUserInfoUI
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import showWindow [as 别名]
def dpGetUserInfoUI(self, *args):
""" First window UI to get the basic user info for sentence ids starting with "_".
"""
self.dpClearTranslatorUI(1)
# starting window:
dpARTranslatorWin1 = cmds.window('dpARTranslatorWin1', title=self.translatorString, iconName='dpAutoRig', widthHeight=(500, 180), menuBar=False, sizeable=True, minimizeButton=True, maximizeButton=True)
dpARTranslatorLayout1 = cmds.columnLayout('dpARTranslatorLayout1', adjustableColumn=True, columnOffset=('both', 10), rowSpacing=10, parent=dpARTranslatorWin1)
cmds.separator(style='none', parent=dpARTranslatorLayout1)
self.authorTFG = cmds.textFieldGrp('authorTFG', label=self.langDic[self.langName]['t002_yourName'], text='', adjustableColumn2=1, parent=dpARTranslatorLayout1)
self.emailTFG = cmds.textFieldGrp('emailTFG', label=self.langDic[self.langName]['t003_emailContact'], text='', adjustableColumn2=1, parent=dpARTranslatorLayout1)
self.websiteTFG = cmds.textFieldGrp('websiteTFG', label=self.langDic[self.langName]['t004_websiteContact'], text='', adjustableColumn2=1, parent=dpARTranslatorLayout1)
self.newLanguageTFG = cmds.textFieldGrp('newLanguageTFG', label=self.langDic[self.langName]['t005_langName'], text='', adjustableColumn2=1, parent=dpARTranslatorLayout1)
cmds.button('startTranslationBT', label=self.langDic[self.langName]['t006_startTranslator'], command=self.dpCollectUserInfo, parent=dpARTranslatorLayout1)
# show UI:
cmds.showWindow(dpARTranslatorWin1)
示例13: dpColorizeUI
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import showWindow [as 别名]
def dpColorizeUI(self, *args):
""" Show a little window to choose the color of the button and the override the guide.
"""
#Get Maya colors
#Manually add the "none" color
colorList = [[0.627, 0.627, 0.627]]
#WARNING --> color index in maya start to 1
colorList += [cmds.colorIndex(iColor, q=True) for iColor in range(1,32)]
# creating colorOverride Window:
if cmds.window('dpColorOverrideWindow', query=True, exists=True):
cmds.deleteUI('dpColorOverrideWindow', window=True)
colorOverride_winWidth = 170
colorOverride_winHeight = 115
dpColorOverrideWin = cmds.window('dpColorOverrideWindow', title='Color Override '+DPCO_VERSION, iconName='dpColorOverride', widthHeight=(colorOverride_winWidth, colorOverride_winHeight), menuBar=False, sizeable=True, minimizeButton=False, maximizeButton=False, menuBarVisible=False, titleBar=True)
# creating layout:
colorTabLayout = cmds.tabLayout('colorTabLayout', innerMarginWidth=5, innerMarginHeight=5, parent=dpColorOverrideWin)
# Index layout:
colorIndexLayout = cmds.gridLayout('colorIndexLayout', numberOfColumns=8, cellWidthHeight=(20,20), parent=colorTabLayout)
# creating buttons
for colorIndex, colorValues in enumerate(colorList):
cmds.button('indexColor_'+str(colorIndex)+'_BT', label=str(colorIndex), backgroundColor=(colorValues[0], colorValues[1], colorValues[2]), command=partial(self.dpSetColorIndexToSelect, colorIndex), parent=colorIndexLayout)
# RGB layout:
colorRGBLayout = cmds.columnLayout('colorRGBLayout', adjustableColumn=True, columnAlign='left', rowSpacing=10, parent=colorTabLayout)
cmds.separator(height=10, style='none', parent=colorRGBLayout)
self.colorRGBSlider = cmds.colorSliderGrp('colorRGBSlider', label='Color', columnAlign3=('right', 'left', 'left'), columnWidth3=(30, 60, 50), columnOffset3=(10, 10, 10), rgbValue=(0, 0, 0), changeCommand=self.dpSetColorRGBToSelect, parent=colorRGBLayout)
# renaming tabLayouts:
cmds.tabLayout(colorTabLayout, edit=True, tabLabel=((colorIndexLayout, "Index"), (colorRGBLayout, "RGB")))
# call colorIndex Window:
cmds.showWindow(dpColorOverrideWin)
示例14: copyPasteAttrUI
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import showWindow [as 别名]
def copyPasteAttrUI(self, *args):
""" UI (window).
"""
self.closeCopyPasteAttrUI()
# UI:
dpCopyPasteAttrWin = cmds.window('dpCopyPasteAttrWin', title='CopyPasteAttr - v'+DPCP_VERSION, width=200, height=75, sizeable=True, minimizeButton=False, maximizeButton=False)
# UI elements:
mainLayout = cmds.columnLayout('mainLayout', width=150, height=75, adjustableColumn=True, parent=dpCopyPasteAttrWin)
copyButton = cmds.button('copyButton', label=self.langDic[self.langName]['i122_copyAttr'], command=partial(self.ctrls.copyAttr, verbose=True), backgroundColor=(0.7, 1.0, 0.7), parent=mainLayout)
pasteButton = cmds.button('pasteButton', label=self.langDic[self.langName]['i123_pasteAttr'], command=partial(self.ctrls.pasteAttr, verbose=True), backgroundColor=(1.0, 1.0, 0.7), parent=mainLayout)
copyAndPasteButton = cmds.button('copyAndPasteButton', label=self.langDic[self.langName]['i124_copyPasteAttr'], command=partial(self.ctrls.copyAndPasteAttr, True), backgroundColor=(0.7, 0.9, 1.0), parent=mainLayout)
# calling UI:
cmds.showWindow(dpCopyPasteAttrWin)
示例15: __init__
# 需要导入模块: from maya import cmds [as 别名]
# 或者: from maya.cmds import showWindow [as 别名]
def __init__(self, *args, **kwargs):
if cmds.window("CopyPasteShapes", query=True, exists=True):
cmds.deleteUI("CopyPasteShapes")
win = cmds.window('sqCopyPasteShapesWindow', title='CopyPasteShapes', widthHeight=(200, 100), menuBar=False, sizeable=True, minimizeButton=True, maximizeButton=False, menuBarVisible=False, titleBar=True)
layout = cmds.columnLayout('sqCopyPasteShapesLayout', adjustableColumn=True, parent=win)
cmds.button('sqCopyPasteShapesBtnSave', label="Save", backgroundColor=(0.8, 0.8, 1.0), command=self.onBtnSavePressed, parent=layout)
cmds.button('sqCopyPasteShapesBtnLoad', label="Load", backgroundColor=(1.0, 0.8, 0.8), command=self.onBtnLoadPressed, parent=layout)
cmds.showWindow(win)