Playblast Python Progress Bar

70 views
Skip to first unread message

Dhruba Jyoti

unread,
Mar 17, 2021, 3:42:48 PMMar 17
to Python Programming for Autodesk Maya
I have created a very basic tool that will create a playblast with all the desired settings, now all I need to do is to attach with a progress bar.

Can someone help me with how to do it?

Here is the Playblast Script

import maya.cmds as cmds
import os
srtfrm = cmds.getAttr('defaultRenderGlobals.startFrame')
endfrm = cmds.getAttr('defaultRenderGlobals.endFrame')
cmds.playblast(f=test, fo=True, fmt='qt', c='H.264', w=1280, h=720, p=100, qlt=100, orn=False, st=srtfrm, et=endfrm, v=False, os=True)

Here is the Progress Bar

import maya.cmds as cmds
srtfrm = cmds.getAttr('defaultRenderGlobals.startFrame')
endfrm = cmds.getAttr('defaultRenderGlobals.endFrame')
winID= 'PlayblastUI'
if cmds.window(winID, exists=True):
    cmds.deleteUI(winID)
window = cmds.window(winID, title='Make Playblast', resizeToFitChildren=True, sizeable=False, tlb=True )
cmds.columnLayout()
progressControl = cmds.progressBar(maxValue=endfrm-srtfrm, width=325)
cmds.setParent('..')
cmds.rowColumnLayout(numberOfRows=1,rowHeight=(5,5))
cmds.setParent('..')
cmds.rowLayout(numberOfColumns=2)
cmds.button( label='Playblast', w = 200, command='cmds.progressBar(progressControl, edit=True, step=1)' )
cmds.text(label='           © 2020', font='smallPlainLabelFont')
cmds.setParent('..')
cmds.showWindow()

tomas mikulak

unread,
Mar 17, 2021, 3:58:24 PMMar 17
to python_in...@googlegroups.com
Hi,
try to check this link https://vimeo.com/175371070


st 17. 3. 2021 o 20:42 Dhruba Jyoti <vfx.d...@gmail.com> napísal(a):
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c716dbac-f59f-4a4b-9c54-e906bce847cbn%40googlegroups.com.

Dhruba Jyoti

unread,
Mar 19, 2021, 1:00:48 PMMar 19
to Python Programming for Autodesk Maya
Thanks for the help, but it didn't help that much. Can you or someone be little more specific about my problem?

Justin Israel

unread,
Mar 19, 2021, 5:39:22 PMMar 19
to python_in...@googlegroups.com


On Sat, 20 Mar 2021, 6:00 am Dhruba Jyoti, <vfx.d...@gmail.com> wrote:
Thanks for the help, but it didn't help that much. Can you or someone be little more specific about my problem?


When you start the progress bar, you have to continue to advance the step value as your work progresses. Looks like you start the progress bar but show no code where you loop and update the step value towards the max. Without this, the progress bar stays still. 

tomas mikulak

unread,
Mar 19, 2021, 7:22:01 PMMar 19
to python_in...@googlegroups.com
I don't have time to write it, but I would say you need to write a function for progressbar that wil be driven by event, frame change(not really name of an event), use scriptJob for that and function should give you just animation percentage of current frame and returned value will be set by progressbar edit. I think that when you playblast maya freezes, same as sims. only expressions and scriptJobs could be live. 
Or just create an expression for it and after blast delete it.

st 17. 3. 2021 o 20:42 Dhruba Jyoti <vfx.d...@gmail.com> napísal(a):
I have created a very basic tool that will create a playblast with all the desired settings, now all I need to do is to attach with a progress bar.
Reply all
Reply to author
Forward
0 new messages