Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9202065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:10:11+00:00 2026-06-17T23:10:11+00:00

I am checking the progress bar’s value and if it’s 100, I want to

  • 0

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…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:10:12+00:00Added an answer on June 17, 2026 at 11:10 pm

    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.

    import maya.cmds as cmds
    
    cmds.progressBar('progressBar') # initialise the progress bar
    
    def callback():  
      # Begin loop from 0 to 100 - remember range(n) returns numbers from 0 (inclusive) to n (exclusive)
      for i in range(101):
          cmds.progressBar('progressBar', edit=True, step=1) # increase step by 1
          if (cmds.progressBar('progressBar',q=True, progress=True)==100):
              print "Finished Uploading."
              break
              # Theoretically, breaking is simply here so that you stop wasting iterations in some cases,
              # but it's not necessary for the printout, since we have only specified that the print will
              # happen when the progress value is equal to exactly 100.
              # Finally, if there is NO loop (like the code you pasted originally), then you shouldn't have
              # a break.
    
    callback()
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want my app to show a running progress bar while doing some components
Checking few RDBMS I find that things like SELECT COUNT (a), SUM (b) FROM
Checking the documentation online I saw that it is pass by reference. Can someone
I want to show the user detailed progress information when performing potentially lengthy database
Checking function takes two arguments, I want to have a testcase for each element
How to check the progress of an upload that use GoogleDrive API? The service.files().insert(body,
Currently I am working on a C++/clr application that is slowly making progress. When
Hello i am developing an automatic update system which has a progress bar which
I have a progress bar in my app but it is showing some text
I have a script that loops through IPs on my local network, checking if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.