diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-05-21 17:09:35 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-05-21 17:09:35 +0300 |
commit | 951db20862dab11e9b40dae83fcb221aa1d1df4f (patch) | |
tree | a383aa9727b64666c4a7d28bacdabc4439985fda /source/blender/editors | |
parent | c1b7acda4ca7acb694f0f23340b74017eab69a84 (diff) |
Dynamicpaint: fix (unreported) missing progress bar in early baking stage.
Nothing was shown in UI during pre-bake step, while it can take several minutes
to complete with heavy geometry.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/physics/dynamicpaint_ops.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c index a5d2d2c8be7..3d7a45843cc 100644 --- a/source/blender/editors/physics/dynamicpaint_ops.c +++ b/source/blender/editors/physics/dynamicpaint_ops.c @@ -350,6 +350,9 @@ static void dynamicPaint_bakeImageSequence(DynamicPaintBakeJob *job) return; } + /* Show progress bar. */ + *(job->do_update) = true; + /* Set frame to start point (also inits modifier data) */ frame = surface->start_frame; orig_frame = scene->r.cfra; @@ -357,14 +360,15 @@ static void dynamicPaint_bakeImageSequence(DynamicPaintBakeJob *job) ED_update_for_newframe(job->bmain, scene, 1); /* Init surface */ - if (!dynamicPaint_createUVSurface(scene, surface)) { + if (!dynamicPaint_createUVSurface(scene, surface, job->progress, job->do_update)) { job->success = 0; return; } /* Loop through selected frames */ for (frame = surface->start_frame; frame <= surface->end_frame; frame++) { - float progress = (frame - surface->start_frame) / (float)frames; + /* The first 10% are for createUVSurface... */ + const float progress = 0.1f + 0.9f * (frame - surface->start_frame) / (float)frames; surface->current_frame = frame; /* If user requested stop, quit baking */ |