[Bf-python] Support for a primitive progress bar is available

Gaia gaia.clary at machinimatrix.org
Fri Apr 19 17:14:46 CEST 2013


Hi;

We now (revision 56169) have a minimal progress bar.
Currently the progress is indicated by a number in the
range [0,9999]. This number is displayed instead of the
mouse cursor and it will show up as a 2*2 matrix
with 2 digits on each row.

The minimal progress bar even works when the user interface
is blocked during a long running script. The python interface
has been setup for future support of a true progress bar.


The python interface consists of 3 functions:

1.) bpy.context.window_manager.progress_begin(min,max)

     This function must be called to initialise the propertybar.
     If it is not called, then the propertybar will not show up!

     min,max (float) is the number range for the property bar
     This range is currently mapped to a range [0,9999]
     to match the constraints of the cursor change function.

     Note: The range must be > 0. otherwise the progressbar
     will not be displayed.

2.) bpy.context.window_manager.progress_update(val)

     Only when this function is called the cursor changes
     its appearance.

     val (float) must be a number in the range [min, max]
     it is not checked if the number is in the correct range.

3.) bpy.context.window_manager.progress_end()

     You call this function to change the cursor back to its
     default appearance before your script terminates.

Here is a demo blend file with a minimal script that
shows how you can use the property bar:

http://www.pasteall.org/blend/20832

Thanks for Ideasman_42 and kaito for suggestions and help!

cheers,
Gaia



More information about the Bf-python mailing list