From 951db20862dab11e9b40dae83fcb221aa1d1df4f Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sat, 21 May 2016 16:09:35 +0200 Subject: 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. --- source/blender/editors/physics/dynamicpaint_ops.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/physics/dynamicpaint_ops.c') 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 */ -- cgit v1.2.3