HI, It seems odd it's mapped [0, 9999] instead of something that's a direct representation of a percentage -- either [0.0, 1.0] or [0, 99] -- since you most likely have to do a percentage calculation to figure out the progress anyway.
progress_update(items_finished/total_items) vs. progress_update((items_finished/total_items)*1000) Dan On Fri, Apr 19, 2013 at 8:14 AM, Gaia <[email protected]> wrote: > 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 > _______________________________________________ > Bf-python mailing list > [email protected] > http://lists.blender.org/mailman/listinfo/bf-python >
_______________________________________________ Bf-python mailing list [email protected] http://lists.blender.org/mailman/listinfo/bf-python
