本文整理汇总了Python中maya.cmds.iconTextButton函数的典型用法代码示例。如果您正苦于以下问题:Python iconTextButton函数的具体用法?Python iconTextButton怎么用?Python iconTextButton使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了iconTextButton函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createTextField
def createTextField(self, createRename, enterCommand, offCommand):
mainLayout = cmds.columnLayout(w=1, columnWidth=self.createRenameLayoutW,
parent=self.selSetsLayout,
visible=False
)
fistRowLayout = cmds.rowLayout(numberOfColumns=3, parent=mainLayout)
textField = cmds.textField(height=20, width=self.createRenameLayoutW-21,
alwaysInvokeEnterCommandOnReturn=True,
parent=fistRowLayout,
enterCommand=enterCommand
)
# X button text field
cmds.iconTextButton(style='iconOnly', h=18, w=18,
image=uiMod.getImagePath("specialTools_x"),
highlightImage=uiMod.getImagePath("specialTools_x copy"),
command=offCommand, annotation="Cancel",
parent=fistRowLayout
)
cmds.rowLayout(numberOfColumns=len(self.colors)+1, parent=mainLayout)
for loopColor in self.colors:
colorName = loopColor["name"]
colorValue = loopColor["value"]
cmds.iconTextButton("colorButton%s%s"%(createRename, colorName),
style='iconOnly',
bgc=colorValue,
height=15, width=15,
command=lambda colorName=colorName, *args: enterCommand(colorName=colorName)
)
return {"mainLayout":mainLayout, "textField":textField}
示例2: fillAttrList
def fillAttrList( self ):
# Clean up UI elements for refreshing the list.
lChildren = cmds.scrollLayout( self.attrList, query=True, childArray=True )
if lChildren is not None:
for c in lChildren:
cmds.deleteUI( c )
# Build list for UI.
previousColor = 2
attList = getAttrXML()
for attr in attList:
attr = [{ 'attrName':attr['name'], 'attrType':attr['attrType'], 'attrDataType':attr['attrDataType'] }]
# Set the row color.
color = 1
if previousColor is 1:
color = 2
previousColor = 2
else:
color = 1
previousColor = 1
# Make the row.
self.attrListColumn = cmds.rowColumnLayout( parent=self.attrList, numberOfColumns=3,
columnWidth=[(1,104),(2,50),(3,20)],
columnSpacing=[(1,2),(2,2),(3,2)],
backgroundColor=self.rowColors[color-1] )
cmds.text( label=attr[0]['attrName'] )
cmds.iconTextButton( annotation='Add', style='iconOnly',
width=16, image1='icon_plus16.png',
command=lambda a1=attr: addAttr( a1 ) )
self.checkBox = cmds.checkBox( label='' )
cmds.setParent( '..' )#self.attrListColumn
示例3: checkUpdates
def checkUpdates(self, gui, layout, *args):
if self.tryUpdate():
if not G.GT_wasUpdated:
hasUpdate = self.hasUpdate()
if hasUpdate != False:
cmds.iconTextButton(label="Updating...", style='textOnly', h=gui.hb, parent=layout)
cmds.progressBar("aToolsProgressBar", maxValue=100, width=50, parent=layout)
if hasUpdate == "offline_update":
offlinePath = aToolsMod.loadInfoWithUser("userPrefs", "offlinePath")
offlineFolder = offlinePath[0]
offlineFilePath = "%s%saTools.zip"%(offlineFolder, os.sep)
downloadUrl = "file:///%s%saTools.zip"%(offlineFolder, os.sep)
fileModTime = os.path.getmtime(offlineFilePath)
offline = [offlineFilePath, fileModTime]
else:
downloadUrl = DOWNLOAD_URL
offline = None
function = lambda *args:self.updateaTools(downloadUrl, offline)
G.deferredManager.sendToQueue(function, 1, "checkUpdates")
return
self.warnUpdate()
示例4: stretchButtonsWidth
def stretchButtonsWidth(self, buttonSets):
if not cmds.window(self.mainWin, query=True, exists=True): return
mayaWinSize = cmds.window(self.mainWin, query=True, width=True)
buttonsLayoutSize = cmds.rowLayout(self.mainLayout, query=True, width=True)
if buttonsLayoutSize < mayaWinSize: return
diference = buttonsLayoutSize - mayaWinSize
sizeChart = [cmds.iconTextButton('aToolsSetBtn_%s'%loopSet, query=True, w=True) for loopSet in buttonSets]
x = 0
while True:
for n, loopSet in enumerate(buttonSets):
x += 1
if x > diference: break
if max(sizeChart) == 1:
x = diference +1
break
sizeChart[sizeChart.index(max(sizeChart))] = max(sizeChart) -1
if x > diference: break
for n, loopSet in enumerate(buttonSets):
cmds.iconTextButton('aToolsSetBtn_%s'%loopSet, edit=True, w=sizeChart[n])
示例5: sortSelSetButtons
def sortSelSetButtons(self, fromSelSet=None, renameSet=None):
if not fromSelSet: index = 0
else: index = self.aToolsSets.index(fromSelSet)
cmds.columnLayout(self.renameSetLayout, edit=True, parent=self.limboLayout)
for loopSet in self.aToolsSets[index:]:
extracted = self.extractInfoFromSelSet(loopSet)
colorName = extracted["colorName"]
if colorName not in G.SS_showColors:
cmds.iconTextButton('aToolsSetBtn_%s'%loopSet, edit=True, parent=self.limboLayout, visible=False)
continue
if loopSet == renameSet:
cmds.columnLayout(self.renameSetLayout, edit=True, parent=self.selSetsLayout)
cmds.iconTextButton('aToolsSetBtn_%s'%loopSet, edit=True, visible=False, w=1)
continue
cmds.iconTextButton('aToolsSetBtn_%s'%loopSet, edit=True, parent=self.limboLayout)
cmds.iconTextButton('aToolsSetBtn_%s'%loopSet, edit=True, parent=self.selSetsLayout, visible=True)
if self.selSetButtonWidth.has_key(loopSet): cmds.iconTextButton('aToolsSetBtn_%s'%loopSet, edit=True, w=self.selSetButtonWidth[loopSet])
示例6: settings_archive
def settings_archive(mayaFile, todo, settings):
def filepicker():
result = cmds.fileDialog2(ds=2, cap="Select a Folder.", fm=3, okc="Select")
return result[0] if result else ""
archive = settings.get("FileArchive.active", False)
path = settings.get("FileArchive.path")
# Use File Archiving
cmds.columnLayout(
adjustableColumn=True,
ann="Store a backup of the current scene into the provided folder upon each Todo completion.",
bgc=[0.5, 0.5, 0.5] if archive else [0.2, 0.2, 0.2])
cmds.checkBox(
l="Use File Archive",
v=archive,
cc=lambda x: settings.set("FileArchive.active", x))
# File archive path
cmds.rowLayout(nc=2, ad2=2)
cmds.text(label=" - ")
cmds.iconTextButton(
en=archive,
image="fileOpen.png",
l=path if path else "Pick archive folder.",
style="iconAndTextHorizontal",
c=lambda: settings.set("FileArchive.path", filepicker())) # TODO errors when no folder is chosen because of 0 index
cmds.setParent("..")
cmds.setParent("..")
示例7: _GUI_Create
def _GUI_Create(s, parent):
s._attr["specialIcon"] = s._attr.get("specialIcon", None)
s._attr["specialAnn"] = s._attr.get("specialAnn", None)
complete = s._events["complete"]
special = s._events["special"]
delete = s._events["delete"]
edit = s._events["edit"]
s._root = cmds.rowLayout(nc=4, ad4=1, p=parent)
s._labelBtn = cmds.iconTextButton(
h=30,
style="iconAndTextHorizontal",
fn="fixedWidthFont",
c=lambda: complete(s)
)
s._specialBtn = cmds.iconTextButton(
style="iconOnly",
w=30,
m=False,
c=lambda: special(s)
)
s._editBtn = cmds.iconTextButton(
style="iconOnly",
w=30,
c=lambda: edit(s)
)
s._deleteBtn = cmds.iconTextButton(
style="iconOnly",
w=30,
c=lambda: delete(s)
)
示例8: _showUI
def _showUI(self):
if cmds.window(self.win, exists=True):
cmds.deleteUI(self.win, window=True)
cmds.window(self.win, title=self.win, widthHeight=(400, 220))
cmds.columnLayout('uicl_audioMain',adjustableColumn=True)
cmds.separator(h=15, style='none')
cmds.text(l='Select Audio to Offset')
cmds.separator(h=15, style='in')
cmds.rowColumnLayout(numberOfColumns=3, columnWidth=[(1, 100), (2, 90), (3, 100)])
cmds.button(label='<< Offset',
ann='Nudge selected Audio Backwards',
command=partial(self.offsetSelectedBy,'negative'))
cmds.floatField('AudioOffsetBy', value=10)
cmds.button(label='Offset >>',
ann='Nudge selected Audio Forwards',
command=partial(self.offsetSelectedBy,'positive'))
cmds.setParent('..')
cmds.separator(h=15, style='in')
cmds.rowColumnLayout(numberOfColumns=2, columnWidth=[(1, 200), (2, 90)])
cmds.button(label='Offset Range to Start at:',
ann='offset the selected range of audionodes such that they start at the given frame',
command=self.offsetSelectedTo)
cmds.floatField('AudioOffsetToo', value=10)
cmds.setParent('..')
cmds.separator(h=15, style='in')
cmds.button(label='Ripple selected',
ann="Ripple offset the selected audio nodes so they're timed one after another",
command=self.offsetRipple)
cmds.separator(h=15, style='none')
cmds.iconTextButton(style='iconOnly', bgc=(0.7, 0, 0), image1='Rocket9_buttonStrap2.bmp',
c=lambda *args: (r9Setup.red9ContactInfo()), h=22, w=200)
cmds.showWindow(self.win)
cmds.window(self.win, e=True, widthHeight=(290, 190))
示例9: createLayout
def createLayout(self):
mainLayout = cmds.rowLayout(numberOfColumns=6, parent=self.parentLayout)
#manipulator orientation
#cmds.iconTextButton("manipOrientButton", style='textOnly', label='-', h=self.hb, annotation="Selected objects", command=updateManipOrient)
#launchManipOrient()
self.autoSmartSnapKeys = AutoSmartSnapKeys()
self.selectionCounter = SelectionCounter()
#selection
cmds.iconTextButton("selectionCounterButton", style='textOnly', font="smallPlainLabelFont", label='0', h=self.hb, annotation="Selected objects")
cmds.popupMenu("selectionCounterButtonMenu", button=1, postMenuCommand=self.selectionCounter.populateMenu)
#animation crash recovery
cmds.image("animationCrashRecoveryLed", w=14, h=14, annotation="Test")
#menu
cmds.iconTextButton(style='iconOnly', w=self.wb, h=self.hb, image= uiMod.getImagePath("aTools"), highlightImage= uiMod.getImagePath("aTools copy"), annotation="aTools Menu")
self.popUpaToolsMenu()
self.update = Update()
self.update.about = self.about
self.update.checkUpdates(self, mainLayout)
# set default config and startup scripts
self.setDefaultConfig()
示例10: installCopyRightInfo
def installCopyRightInfo(self):
""""""
cmds.frameLayout(lv=False, bs='etchedIn', mh=6, mw=6, w=1)
cmds.text(l="Soft Cluster EX", fn='boldLabelFont', align='center')
cmds.rowColumnLayout( numberOfColumns=2,
rowSpacing=[1, 8],
columnAttach=[1, "right", 5],
columnAlign=[1, "right"])
cmds.text(l="Version: ", fn='boldLabelFont')
cmds.text(l=setup.getVersion(), align='left')
cmds.text(l="Author: ", fn='boldLabelFont')
cmds.text(l="Webber Huang", align='left')
cmds.text(l="Contact: ", fn='boldLabelFont')
cmds.text(l="[email protected]", align='left')
cmds.text(l="Project Site: ", fn='boldLabelFont')
cmds.iconTextButton( style='textOnly',
l='http://riggingtd.com/downloads/soft-cluster-ex',
ann="Click to open in brower.",
c = lambda *args: setup.openBlog() )
cmds.setParent( ".." )
cmds.setParent( ".." )
示例11: copyWorld
def copyWorld(self, *args):
#print "copyworld"
self.selection = cmds.ls(selection=True)
if len(self.selection) < 1: return
if len(self.selection) > 20:
message = "Too many objects selected, continue?"
confirm = cmds.confirmDialog( title='Confirm', message=message, button=['Yes','No'], defaultButton='Yes', cancelButton='No', dismissString='No' )
if confirm != 'Yes': return
cmds.refresh(suspend=True)
cmds.undoInfo(stateWithoutFlush=False)
self.flushCopyCache(force=True)
self.scriptJob()
self.sourceObjs = self.selection
self.targetObj = "world"
for loopObj in self.sourceObjs:
matrix = cmds.xform(loopObj, query=True, ws=True, matrix=True)
self.copyCache.append(matrix)
cmds.iconTextButton("fakeConstrainBtn", edit=True, image= uiMod.getImagePath("specialTools_fake_constrain_active"), highlightImage= uiMod.getImagePath("specialTools_fake_constrain_active copy"))
cmds.refresh(suspend=False)
cmds.undoInfo(stateWithoutFlush=True)
示例12: setup
def setup():
try:
iconWH = 26
# modify the status line
gStatusLine = mel.eval("global string $gStatusLine;\n $temp=$gStatusLine")
if gStatusLine != "":
tempwin = cmds.window()
temp = cmds.formLayout(p=tempwin)
savePlusSceneButton = cmds.iconTextButton(
"savePlusSceneButton2", image1="save_32.png", w=iconWH, h=iconWH, c=save
)
reloadMyShelfButton = cmds.iconTextButton(
"reloadAWShelfButton", image1="reload_32.png", w=iconWH, h=iconWH, c=reloadAWShelf
)
reloadShelfButton = cmds.iconTextButton(
"reloadRiggingShelfButton", image1="riggingShelf_32.png", w=iconWH, h=iconWH, c=reloadRiggingShelf
)
reloadAnimShelfButton = cmds.iconTextButton(
"reloadAnimShelfButton", image1="animShelf_32.png", w=iconWH, h=iconWH, c=reloadAnimShelf
)
addChildFlowLayout(gStatusLine, savePlusSceneButton, 5)
addChildFlowLayout(gStatusLine, reloadMyShelfButton, 6)
addChildFlowLayout(gStatusLine, reloadShelfButton, 7)
addChildFlowLayout(gStatusLine, reloadAnimShelfButton, 8)
except:
print "andresMayaSetup.py trace: No GUI found"
示例13: add_script_editor_toolbar
def add_script_editor_toolbar():
# this is the last contorl on script editor tool bar
goto_btn = mc.iconTextButton(
'scriptEditorToolbarGotoLineButton', q=1, fullPathName=1)
flow_layout = re.search('.*(?=\|)', goto_btn).group()
for x in reversed(mc.layout(flow_layout, q=1, ca=1)):
if x == 'scriptEditorToolbarGotoLineButton':
break
else:
mc.deleteUI(x)
mc.setParent(flow_layout)
iconSize = 23
mc.separator(height=iconSize, horizontal=0, style='single')
mc.iconTextButton(
width=iconSize, height=iconSize,
annotation='save tabs',
image="save.png",
c=lambda *x: save_tabs()
)
mc.iconTextButton(
width=iconSize, height=iconSize,
annotation='load tabs',
image="refresh.png",
c=lambda *x: load_tabs()
)
示例14: _buildSettings
def _buildSettings(s, *args):
"""
Load the settings page
"""
s.page = "settings"
s._clear()
cmds.columnLayout(adj=True, p=s.wrapper)
cmds.iconTextButton(
h=30,
ann="Click to return to your Todo list.",
image="revealSelected.png",
label="<- Todo",
style="iconAndTextHorizontal",
c=s._buildTodo)
cmds.separator()
cmds.text(label="Settings are unique to each Maya scene.", h=50)
frame = cmds.frameLayout(l="Archive options:")
# Settings module
s.fireHook("settings.archive", settings=s._buildSettings, callback=lambda x: cmds.setParent(frame))
cmds.setParent("..")
cmds.frameLayout(l="Feedback:")
cmds.iconTextButton(
image="party.png",
ann="Have any feedback? Good or bad. Love to hear it! :)",
l="Leave Feedback...",
style="iconAndTextHorizontal",
c=lambda: universalOpen("mailto:[email protected]?subject=Todo Feedback")) # TODO errors when no folder is chosen because of 0 index
示例15: _showUI
def _showUI(self):
if cmds.window(self.win, exists=True):
cmds.deleteUI(self.win, window=True)
cmds.window(self.win, title=self.win, widthHeight=(400, 220))
cmds.columnLayout('uicl_audioMain',adjustableColumn=True)
cmds.separator(h=15, style='none')
cmds.separator(h=15, style='in')
cmds.rowColumnLayout(numberOfColumns=3, columnWidth=[(1, 100), (2, 90), (3, 100)])
cmds.button(label='<< Offset',
ann='Nudge selected Audio Backwards',
command=partial(self.offsetSelectedBy,'negative'))
cmds.floatField('AudioOffsetBy', value=10)
cmds.button(label='Offset >>',
ann='Nudge selected Audio Forwards',
command=partial(self.offsetSelectedBy,'positive'))
cmds.setParent('..')
cmds.separator(h=15, style='in')
cmds.rowColumnLayout(numberOfColumns=2, columnWidth=[(1, 200), (2, 90)])
cmds.button(label='Offset Range to Start at:',
ann='offset the selected range of audionodes such that they start at the given frame',
command=self.offsetSelectedTo)
cmds.floatField('AudioOffsetToo', value=10)
cmds.setParent('..')
cmds.button(label='Ripple selected',
ann="Ripple offset the selected audio nodes so they're timed one after another",
command=self.offsetRipple)
cmds.separator(h=15, style='none')
cmds.frameLayout(label='PRO : Broadcast Wav support', cll=True, cl=False, borderStyle='etchedOut')
cmds.columnLayout(adjustableColumn=True, en=r9Setup.has_pro_pack())
cmds.separator(h=5, style='none')
cmds.text(label="NOTE: These will only run if the audio is\nin the Bwav format and has internal timecode data.")
cmds.separator(h=10, style='none')
cmds.button(label='Sync Bwavs to Internal Timecode',
ann='Sync audio nodes to their originally recorded internal timecode reference',
command=self.sync_bwavs)
cmds.separator(h=10, style='in')
cmds.rowColumnLayout(numberOfColumns=2, columnWidth=[(1, 100)], columnSpacing=[(2,20)])
cmds.button(label='Set Timecode Ref',
ann="Set the audio node to use as the reference timecode so all other become relative to this offset",
command=self.__uicb_setReferenceBwavNode)
cmds.text('bwavRefTC', label='No Reference Set')
cmds.setParent('..')
cmds.button(label='Sync Bwavs Relative to Selected',
ann="Sync audio nodes via their internal timecodes such that they're relative to that of the given reference",
command=self.sync_bwavsRelativeToo)
cmds.separator(h=10, style='in')
cmds.rowColumnLayout(numberOfColumns=2, columnWidth=[(1, 140),(2,140)])
cmds.button(label='Timecode HUD : ON',
ann="Live monitor internal Timecode - From a selected node with Timecode Attrs",
command=self.timecodeHud)
cmds.button(label='Timecode HUD : Kill',
ann="Kill all HUD's",
command=r9Meta.hardKillMetaHUD)
cmds.setParent('uicl_audioMain')
cmds.separator(h=10, style='none')
cmds.iconTextButton(style='iconOnly', bgc=(0.7, 0, 0), image1='Rocket9_buttonStrap2.bmp',
c=lambda *args: (r9Setup.red9ContactInfo()), h=22, w=200)
cmds.showWindow(self.win)
cmds.window(self.win, e=True, widthHeight=(290, 350))