• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python cmds.progressBar函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中maya.cmds.progressBar函数的典型用法代码示例。如果您正苦于以下问题:Python progressBar函数的具体用法?Python progressBar怎么用?Python progressBar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了progressBar函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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()
开发者ID:Italic-,项目名称:maya-prefs,代码行数:26,代码来源:generalToolsUI.py


示例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
开发者ID:akoon,项目名称:OldPipeline,代码行数:30,代码来源:masset.py


示例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
开发者ID:GuidoPollini,项目名称:MuTools,代码行数:34,代码来源:cgm_General.py


示例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...!")
开发者ID:DimondTheCat,项目名称:xray,代码行数:34,代码来源:pythonScripts.py


示例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
开发者ID:T00N3,项目名称:T00N3Kit,代码行数:34,代码来源:exportAgiScene.py


示例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    
        
开发者ID:jakebarnwell,项目名称:PythonGenerator,代码行数:27,代码来源:MorpheusFactory.py


示例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
开发者ID:GuidoPollini,项目名称:MuTools,代码行数:7,代码来源:Red9_General.py


示例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
开发者ID:akoon,项目名称:OldPipeline,代码行数:29,代码来源:pym.py


示例9: __enter__

 def __enter__(self):
     if not self.disable:
         cmds.progressBar(self._gMainProgressBar,
                           edit=True,
                           beginProgress=True,
                           isInterruptable=self._interruptable,
                           maxValue=self._maxValue)
开发者ID:santicolomo,项目名称:Red9_StudioPack,代码行数:7,代码来源:Red9_General.py


示例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)
开发者ID:danbradham,项目名称:Aton,代码行数:7,代码来源:aton_maya.py


示例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)
开发者ID:EricTRocks,项目名称:Maya-devkit,代码行数:34,代码来源:pythonScripts.py


示例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)
开发者ID:mocap-ca,项目名称:cleanup,代码行数:7,代码来源:keyTools.py


示例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 )
开发者ID:yuz989,项目名称:MayaScripts,代码行数:33,代码来源:FBXExporter.py


示例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)
开发者ID:GuidoPollini,项目名称:MuTools,代码行数:33,代码来源:remoteMaya_client.py


示例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
开发者ID:mocap-ca,项目名称:cleanup,代码行数:8,代码来源:keyTools.py


示例16: progressBar_init

def progressBar_init(_max):
	global __gMainProgressBar
	try:
		__gMainProgressBar = mel.eval('$tmp = $gMainProgressBar')
		if __gMainProgressBar != "":
			cmds.progressBar(__gMainProgressBar, edit=True, isInterruptable=True, maxValue=_max)
	except:
		__gMainProgressBar = ""
开发者ID:BlackGinger,项目名称:ExocortexCrate,代码行数:8,代码来源:_functions.py


示例17: progressBar_set

    def progressBar_set(self,**kws):
	if not self._str_progressBar:self.progressBar_start()	
	if kws.get('status'):
	    str_bfr = kws.get('status')
	    kws['status'] = "%s > %s"%(self._str_progressBarReportStart,str_bfr) 
	if 'beginProgress' not in kws.keys():kws['beginProgress'] = 1
	try:mc.progressBar(self._str_progressBar,edit = True,**kws)	
	except Exception,error:log.error("%s > failed to set progress bar status | %s"%(self._str_reportStart,error))	
开发者ID:GuidoPollini,项目名称:MuTools,代码行数:8,代码来源:cgm_General.py


示例18: export

    def export(self, path, start, end, step, scale):
        #open file
        res = True
        try:
            mddFile = open(path, 'wb')
        except IOError:
            self.par.msg2(1, 'Error open file ' + path)
            return False
        #get objects
        selection = om.MSelectionList()
        om.MGlobal.getActiveSelectionList(selection)
        pivotFilterSelection = self.filterObjects(selection)

        #first frame
        cmds.currentTime(start, edit=True)
        vertexPositionList = self.getPoints(selection, scale, pivotFilterSelection)
        #variables
        fps = float(mel.eval('currentTimeUnitToFPS'))
        self.par.msg2(2, 'FPS:', fps)
        numframes = int((end - start + 1)/step)
        numverts = len(vertexPositionList)/3
        self.pointCount = numverts
        print 'Frames', numframes
        print  'Point count', numverts
        #start write to file
        mddFile.write(struct.pack(">2i", numframes, numverts))
        times = [(frame/fps)*step for frame in xrange(numframes)]
        # print times
        mddFile.write(struct.pack(">%df" % numframes, *times))
        mddFile.write(struct.pack(">%df" % (numverts*3), *[v for v in vertexPositionList]))
        prev = 0
        #write sequence
        cmds.progressBar(self.par.progress, edit=True, pr=0)
        frame = start
        while frame < end+1:
            # if cmds.progressBar(self.par.progress, q=1, ic=1):
            if self.par.isCacneled():
                self.par.caselExport()
                res =  False
                break
            rng = end-start
            prc = (frame*100.0)/(end-start)
            cmds.progressBar(self.par.progress, edit=True, pr=int(prc))
            prev = int(prc)
            cmds.currentTime(frame, edit=True)
            self.par.statusMsg('Write cache frame '+str(frame))
            vertexPositionList = self.getPoints(selection, scale, pivotFilterSelection)
            if not (numverts*3) == len(vertexPositionList):
                om.MGlobal.displayError('TOPOLOGY HAS CHANGED!!!')
                self.par.msg2(1, 'TOPOLOGY HAS CHANGED!!!')
                res =  False
                break
            mddFile.write(struct.pack(">%df" % (numverts*3), *[v for v in vertexPositionList]))
            frame += step
        #close file
        mddFile.close()
        cmds.currentTime(start, edit=True)
        return res
开发者ID:paulwinex,项目名称:pw_mGeoExporter,代码行数:58,代码来源:mddWriter.py


示例19: progressBar_iter

    def progressBar_iter(self,**kws):
	if not self._str_progressBar:self.progressBar_start()
	if kws.get('status'):
	    str_bfr = kws.get('status')
	    kws['status'] = "%s > %s"%(self._str_progressBarReportStart,str_bfr) 
	if 'step' not in kws.keys():kws['step'] = 1
	if 'beginProgress' not in kws.keys():kws['beginProgress'] = 1
	kws['edit'] = 1
	mc.progressBar(self._str_progressBar, **kws)
开发者ID:GuidoPollini,项目名称:MuTools,代码行数:9,代码来源:cgm_General.py


示例20: sequence_stopped

    def sequence_stopped(self):
        # Stop ipr when finished
        self.stop()

        # Restore default progressive refinement
        cmds.setAttr("defaultArnoldRenderOptions.progressive_rendering", self.defaultRefinement)

        # kill progressBar
        cmds.progressBar(self.gMainProgressBar, edit=True, endProgress=True)
开发者ID:Sosoyan,项目名称:Aton,代码行数:9,代码来源:aton_maya.py



注:本文中的maya.cmds.progressBar函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python cmds.progressWindow函数代码示例发布时间:2022-05-27
下一篇:
Python cmds.popupMenu函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap