本文整理汇总了Python中maya.cmds.progressBar函数的典型用法代码示例。如果您正苦于以下问题:Python progressBar函数的具体用法?Python progressBar怎么用?Python progressBar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了progressBar函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: 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()
示例2: writeObj
def writeObj(self, file_name, progress = False, show_msg = True, scale = mcore.scene_scale()):
all_parts = self.parts()
part_num = len(all_parts)
if progress:
window = mc.window(t = 'Writing %s to obj' % self.set_name)
mc.columnLayout()
progressControl = mc.progressBar(maxValue = part_num, width = 300)
mc.showWindow(window)
f = open(file_name, 'w')
vo = 1
vto = 1
vno = 1
for i in range(len(all_parts)):
part = all_parts[i]
# part.toObjStream(f, group = part.name(reformat = True), v_offset = vo, vt_offset = vto, vn_offset = vno, show_msg = not progress)
part.toObjStream(f, group = part.partName(), v_offset = vo, vt_offset = vto, vn_offset = vno, show_msg = not progress, scale = scale)
vo += part.numPoints()
vto += part.numUVs()
vno += part.numNormals()
if progress:
mc.progressBar(progressControl, edit=True, step=1)
f.close()
if progress:
mc.deleteUI(window)
if show_msg:
print "Write %s to obj done." % self.set_name
return True
示例3: doStartMayaProgressBar
def doStartMayaProgressBar(stepMaxValue = 100, statusMessage = 'Calculating....',interruptableState = True):
"""
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
DESCRIPTION:
Tools to do a maya progress bar. This function and doEndMayaProgressBar are a part of a set. Example
usage:
mayaMainProgressBar = guiFactory.doStartMayaProgressBar(int(number))
for n in range(int(number)):
if mc.progressBar(mayaMainProgressBar, query=True, isCancelled=True ) :
break
mc.progressBar(mayaMainProgressBar, edit=True, status = (n), step=1)
guiFactory.doEndMayaProgressBar(mayaMainProgressBar)
ARGUMENTS:
stepMaxValue(int) - max number of steps (defualt - 100)
statusMessage(string) - starting status message
interruptableState(bool) - is it interuptible or not (default - True)
RETURNS:
mayaMainProgressBar(string)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
"""
mayaMainProgressBar = mel.eval('$tmp = $gMainProgressBar');
mc.progressBar(mayaMainProgressBar, edit=True, endProgress=True)
mc.progressBar( mayaMainProgressBar,
edit=True,
beginProgress=True,
isInterruptable=interruptableState,
status=statusMessage,
minValue = 0,
maxValue= stepMaxValue )
return mayaMainProgressBar
示例4: pythonScripts
def pythonScripts():
if (cmds.menu ('pythonScripts_menu', exists=True)):
print ("Removing old pythonScripts menu...")
cmds.deleteUI ('pythonScripts_menu')
gMainWindow = maya.mel.eval('$temp1=$gMainWindow')
gMainProgressBar = maya.mel.eval('$temp=$gMainProgressBar')
mainDir = findFile('pythonScripts.py')
timer = cmds.timerX()
cmds.waitCursor (state=True)
print ""
cmds.progressBar (gMainProgressBar, edit=True,
beginProgress=True,
isInterruptable=True,
status="Creating pythonScripts...",
maxValue=100)
pMenu = (cmds.menu ('pythonScripts_menu', parent=gMainWindow, tearOff=True, aob=True, label="pythonScripts"))
gen_pythonScripts(mainDir, pMenu)
cmds.waitCursor (state=False)
endTime = cmds.timerX(startTime=timer)
cmds.progressBar (gMainProgressBar, edit=True,
endProgress=True,)
print ("pythonTools has now been updated in: " + str(endTime) + " seconds...!")
示例5: walkParticlesProjection
def walkParticlesProjection(camera, particles, step=1, start=None, end=None, pBar=None):
if start is None:
start = cmds.playbackOptions(q=True, minTime=True)
if end is None:
end = cmds.playbackOptions(q=True, maxTime=True)
start = int(start)
end = int(end)
#pStep = 0 if pBar is None else int(100 / (end - start + 1))
pStep = 1
coords = None
for frame in xrange(start, end + 1):
#log("... FRAME %d ..." % frame)
cmds.currentTime(frame)
points = getParticlesProjection(camera, particles, step)
pid = 0
if coords is None:
coords = [None] * len(points)
for point in points:
if coords[pid] is None:
coords[pid] = [None] * (end - start + 1)
coords[pid][frame - start] = point
pid += 1
if pBar:
cmds.progressBar(pBar, e=1, s=pStep)
return coords
示例6: updateTemplate
def updateTemplate(i_customizationNetwork,**kws):
assert i_customizationNetwork.mClass == 'cgmMorpheusMakerNetwork', "Not a customization Network"
assert i_customizationNetwork.mPuppet.mClass == 'cgmMorpheusPuppet',"Puppet isn't there"
d_customizationData = verify_customizationData(i_customizationNetwork)
i_Morpheus = i_customizationNetwork.mPuppet
if not d_customizationData:
return False
mayaMainProgressBar = gui.doStartMayaProgressBar(len(l_modulesToDoOrder))
for moduleKey in l_modulesToDoOrder:
if mc.progressBar(mayaMainProgressBar, query=True, isCancelled=True ) :
break
mc.progressBar(mayaMainProgressBar, edit=True, status = "Setting:'%s'..."%(moduleKey), step=1)
i_module = i_Morpheus.getModuleFromDict(d_moduleCheck[moduleKey])
if not i_module:
log.warning("Cannot find Module: '%s'"%moduleKey)
return False
log.debug("Building: '%s'"%moduleKey)
i_module.doSize(sizeMode = 'manual',
posList = d_customizationData.get(moduleKey))
i_module.doTemplate(tryTemplateUpdate = True,
**kws)
gui.doEndMayaProgressBar(mayaMainProgressBar)#Close out this progress bar
示例7: __exit__
def __exit__(self, exc_type, exc_value, traceback):
if not self.disable:
cmds.progressBar(self._gMainProgressBar, edit=True, endProgress=True)
if exc_type:
log.exception('%s : %s'%(exc_type, exc_value))
del(self)
return False # False so that the exceptiopn gets re-raised
示例8: writeGeo
def writeGeo(self, folder, progress = False, show_msg = True):
part_num = len(self.parts)
if progress:
window = mc.window(t = 'Writing %s to geo' % self.name)
mc.columnLayout()
progressControl = mc.progressBar(maxValue = part_num * 2, width = 300)
mc.showWindow(window)
for part in self.parts:
if not part.hasGeoDate:
part.createGeoDate()
part.updateGeoDate()
if progress:
mc.progressBar(progressControl, edit=True, step=1)
for i in range(part_num):
part = self.parts[i]
part_obj_name = os.path.join(folder, '%s.geo' % part.partName())
# part_obj_name = os.path.join(folder, '%s.geo' % part.name(reformat = True))
part.writeGeo(part_obj_name)
if progress:
mc.progressBar(progressControl, edit=True, step=1)
if progress:
mc.deleteUI(window)
if show_msg:
print "Write %s to obj done." % self.name
return True
示例9: __enter__
def __enter__(self):
if not self.disable:
cmds.progressBar(self._gMainProgressBar,
edit=True,
beginProgress=True,
isInterruptable=self._interruptable,
maxValue=self._maxValue)
示例10: sequence_stepped
def sequence_stepped(self, frame):
# Refresh IPR
self.IPRUpdate()
# step progressBar
gMainProgressBar = mel.eval('$tmp = $gMainProgressBar')
cmds.progressBar(gMainProgressBar, edit=True, step=1)
示例11: pythonScripts
def pythonScripts():
if cmds.menu("pythonScripts_menu", exists=True):
# print ("Removing old pythonScripts menu...")
cmds.deleteUI("pythonScripts_menu")
gMainWindow = maya.mel.eval("$gMainWindow=$gMainWindow")
gMainProgressBar = maya.mel.eval("$gMainProgressBar=$gMainProgressBar")
mainDir = findFile("pythonScripts.py")
timer = maya.mel.eval("timerX")
cmds.waitCursor(state=True)
# print ""
cmds.progressBar(
gMainProgressBar,
edit=True,
beginProgress=True,
isInterruptable=True,
status="Creating pythonScripts...",
maxValue=100,
)
pMenu = cmds.menu("pythonScripts_menu", parent=gMainWindow, tearOff=True, aob=True, label="pythonScripts")
gen_pythonScripts(mainDir, pMenu)
cmds.waitCursor(state=False)
endTime = maya.mel.eval("timerX -st %(timer)s" % vars())
cmds.progressBar(gMainProgressBar, edit=True, endProgress=True)
示例12: progressEnd
def progressEnd(win, pc) :
''' end the progress '''
if win is None or pc is None : return
m.progressBar( pc, e=True, ep=True)
m.deleteUI(win)
示例13: InitWindow
def InitWindow( self ):
self._window = cmds.window( self.windowID, title = 'FBX Exporter', sizeable=False, resizeToFitChildren=True )
cmds.columnLayout()
cmds.rowColumnLayout( numberOfColumns=3, columnWidth=[(1,self.Layout.CLWIDTH), (2,self.Layout.CLWIDTH), (3,self.Layout.CLWIDTH)], \
rowSpacing=[(1,self.Layout.SPACING), (2,self.Layout.SPACING), (3,self.Layout.SPACING)] )
cmds.text( label='Export current scene' )
cmds.separator(visible=False)
cmds.separator(visible=False)
cmds.button( 'Export All', width=self.Layout.BWIDTH, command=self.button_ExportAll_pressed )
cmds.button( 'Export Selected', width=self.Layout.BWIDTH, command=self.button_ExportSelected_pressed )
cmds.button( 'Open Current Scene', width=self.Layout.BWIDTH, command=self.button_OpenCurrentScene_pressed )
cmds.text( label='Batch export' )
cmds.separator(visible=False)
cmds.separator(visible=False)
cmds.button( 'Add Folder', width=self.Layout.BWIDTH, command=self.button_AddFolder_pressed )
cmds.button( 'Export All Files', width=self.Layout.BWIDTH, command=self.button_ExportAllFiles_pressed )
cmds.button( 'Delete Selected', width=self.Layout.BWIDTH, command=self.button_DeleteSelected_pressed )
cmds.separator()
cmds.separator()
cmds.separator()
cmds.setParent( '..' )
cmds.rowColumnLayout( numberOfColumns=1, columnWidth=(1,3*self.Layout.CLWIDTH) )
cmds.progressBar('ProgressBar', width=3*self.Layout.BWIDTH )
cmds.textScrollList( 'scrollList', allowMultiSelection=False)
cmds.setParent( '..' )
cmds.rowColumnLayout( numberOfColumns=3, columnWidth=[(1,self.Layout.CLWIDTH), (2,self.Layout.CLWIDTH), (3,self.Layout.CLWIDTH)], \
rowSpacing=[(1,self.Layout.SPACING), (2,self.Layout.SPACING), (3,self.Layout.SPACING)] )
cmds.separator()
cmds.separator()
cmds.separator()
cmds.separator(visible=False)
cmds.separator(visible=False)
cmds.button( 'Close', width=self.Layout.BWIDTH, command=self.button_Close_pressed )
示例14: remoteMayaUI
def remoteMayaUI(*args):
if MC.window("remoteMayaUI_WIN", ex=1):
MC.deleteUI("remoteMayaUI_WIN")
MC.window("remoteMayaUI_WIN", t="REMOTE MAYA", tlb=1, s=0, mb=0)
MC.columnLayout()
MC.rowLayout("HOLDER", nc=4, enable=1)
0; MC.text(label=" Episode")
0; MC.optionMenu("EPISODES_OPTIONMENU", changeCommand=refreshShotList)
0; MC.text("SHOT_TEXT", label=" Shot", enable=0)
0; MC.optionMenu("SHOTS_OPTIONMENU", changeCommand="pass", enable=0)
MC.menuItem(label="", p="SHOTS_OPTIONMENU", enable=0)
episodePath = "Y:/01_SAISON_4/09_EPISODES/03_Fabrication_2D/"
episodeList = [x for x in os.listdir(episodePath) if len(x) >= 3 and x[:3] == "YKR"]
0; MC.setParent("..")
MC.menuItem("VOID", label="...", p="EPISODES_OPTIONMENU")
for episode in episodeList:
MC.menuItem(label=episode, p="EPISODES_OPTIONMENU")
MC.rowLayout(nc=2)
0; MC.text(l="", w=68)
0; QtButton(handle="INSPECT", label="INSPECT", action=inspectShot,
lineColor=(100,240,100), background=(60,120,60),
borderRadius=14, paddingTBLR=(0,0,0,0), margin=0, w=120, h=30,
fontFamily="Arial", fontSize=16, fontWeight="bold")
MC.setParent("..")
MC.textField("COMMAND_TEXTFIELD", text = "", changeCommand=mayaClient.manualCommand)
MC.scrollField("PNG_UNIVERSAL_LOG", h=430, font="plainLabelFont", editable=False, wordWrap=True, text="Ready...\n", bgc=(.2,.2,.2))
MC.progressBar("PNG_PROGRESS_BAR", h=16, w=260, manage=0)
MC.showWindow("remoteMayaUI_WIN")
MC.window("remoteMayaUI_WIN", edit=True, w=600, h=300)
示例15: progressInc
def progressInc(pc) :
''' update the progress '''
if pc is None : return
if m.progressBar( pc, q=True, isCancelled=True) : return False;
m.progressBar(pc, e=True, step=1)
return True