0

I have created a script that does playblast, I have made a little Ui also for that just to show the progress of the playblast, but I am unable to figure out how to bind that progress bar with the script, thus asking for little help here.

Here is the Playblast Script

import maya.cmds as cmds
import os
srtfrm = cmds.getAttr('defaultRenderGlobals.startFrame')
endfrm = cmds.getAttr('defaultRenderGlobals.endFrame')
filePath = cmds.file(q=True, sn=True)
fileName = os.path.basename(filePath)
plbPath = filePath.replace(fileName,"")
cmds.playblast(f=plbPath+fileName[:-3], 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)

And Here Is the UI

import maya.cmds as cmds
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=100, 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='     AnD CGI © 2020', font='smallPlainLabelFont')
cmds.setParent('..')
cmds.showWindow()

1 Answer 1

0

As shown in the docs for the progressbar (progressbar help) command the command has to be called with a step size during the execution of the progress, in your case during the creation of the playblast. Since the playblast command itself does not allow to use a callback during blasting, you could try to use a scriptJob which is called during frame updates or an expression which is executed for every frame.

1
  • Well whatever you said I have already searched, I was looking for an example close to my situation or the same, thanks for the help though.
    – AnD CGI
    Mar 22, 2021 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.