this is strange!!!
or maybe I am missing something, but as soon as the user interrupts the progressbar with pressing esc and sources the script again, it only works on the first selected object and not anymore on all objects.
Can anyone tell me what I am missing here?
once you run through the whole progress bar you can source the script again and it will not stop after the first object.
first create some objects to have a mass of objects generating a long progress bar - long enough for us to cancel:
import maya.cmds as mc spheres = 
for i in range (0, 2000):
obj = mc.sphere()
and now the progress bar script:
import maya.cmds as mc selection = mc.ls (sl=1)
counterMaxLength = len (selection)
gMainProgressBar = maya.mel.eval('$tmp = $gMainProgressBar');
status='"loading user selection ..."',
currentCount = 0
for sel in selection:
currentCount += 1
mc.progressBar(gMainProgressBar, edit=True, step=1)
if mc.progressBar(gMainProgressBar, query=True, isCancelled=True):
mc.progressBar(gMainProgressBar, edit=True, endProgress=True)
any Input very appreciated!!
I'm kinda stuck here.