Have a look at the example in the Nuke Docs. (search for "Creating Progress
Bar Dialogs").

Here's the example:

import threading
import time
def selfDestruct():
  task = nuke.ProgressTask("Self Destructing")
  task.setMessage("Deleting files")
  for i in xrange( 0, 100 ):
    if task.isCancelled():
      nuke.executeInMainThread( nuke.message, args=( "Phew!" ) )
      break;
    task.setProgress(i)
    time.sleep( 0.5 )
threading.Thread( None, selfDestruct ).start()



On Tue, Aug 23, 2011 at 1:36 PM, robingraham <
[email protected]> wrote:

> **
> So I have a really cool script that invloves pulling lots of stuff from
> shotgun. I love it, but the only problem is that it can take a long time to
> run (like 30 seconds if the network is slow).
>
> has anyone ever created a progress bar for a long running script? It seems
> like once you start running a python script nothing gets updated until it is
> all done or finds a error. Is this always true? It would be great to have a
> text knob that updates a couple times a second to show that progress is
> actually happening.
>
> Thanks everyone!
>
> _______________________________________________
> Nuke-python mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
>
>
_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to