I am checking the progress bar’s value and if it’s 100, I want to exit so that the finished uploading doesn’t get printed twice. I don’t know why 100 shows up twice if I query the progress bar.
def callback(self,*args):
cmds.progressBar('progbar', edit=True, step=1)
if cmds.progressBar('progbar',q=True, progress=True)==100:
print "Finished Uploading."
break
I have found a similar thread but the scenario in my case is slightly different…
You haven’t provided a sufficient sample of your code in order to be able to help you. First of all, your callback() function contains a break statement even though there is actually no loop in this function.
In any case, I wrote the following sample to check and it actually only prints “Finished uploading” once, when 100 is reached.
A possible reason for your problem is that you exceed 100 steps of progress for your progress bar, and that your progress bar’s maximum value is 100. In this case, as you keep increasing the steps, the value will remain at 100 (which is the maximum) and therefore every time you query if it equals 100, it will return True.
Unfortunately, I can’t answer anything more specific without more specific information from your part.