I am using maya’s native progressBar UI widget and I am having trouble with cancelling the progress. I can’t use the progressWindow, since I need a custom layout and need to support sub-progress bars.
I am having trouble capturing the isCanceled event… isCanceled is never returning True… I assumed it would capture the ESC key, but that does not work… according to the docs, isInterruptable is only valid for the main progressBar and progressWindows, but not for progressBars added to custom UIs…
import time
import maya.cmds as cmds
window = cmds.window()
cmds.columnLayout()
progressControl = cmds.progressBar(maxValue=10, width=300)
cmds.showWindow( window )
for i in range(10):
if cmds.progressBar(progressControl, q=True, ic=True):
break
cmds.progressBar(progressControl, e=True, step=1)
time.sleep(1)