[Bf-blender-cvs] [398de6a86f4] master: Alembic: fix updating of GUI when export progress is made

Sybren A. Stüvel noreply at git.blender.org
Tue Sep 17 14:11:40 CEST 2019


Commit: 398de6a86f47eff66f3a4369033f5df3347f6d94
Author: Sybren A. Stüvel
Date:   Tue Sep 17 14:10:47 2019 +0200
Branches: master
https://developer.blender.org/rB398de6a86f47eff66f3a4369033f5df3347f6d94

Alembic: fix updating of GUI when export progress is made

The `do_update` variable wasn't set after changing the `progress`
variable, causing the GUI only to update on redraw (f.e. when the user
was waving the mouse around).

===================================================================

M	source/blender/alembic/intern/abc_exporter.cc
M	source/blender/alembic/intern/abc_exporter.h
M	source/blender/alembic/intern/alembic_capi.cc

===================================================================

diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc
index 94263f61518..69a376d00b0 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -263,7 +263,7 @@ void AbcExporter::getFrameSet(unsigned int nr_of_samples, std::set<double> &fram
   }
 }
 
-void AbcExporter::operator()(float *progress, bool *was_canceled)
+void AbcExporter::operator()(short *do_update, float *progress, bool *was_canceled)
 {
   std::string scene_name;
 
@@ -333,6 +333,7 @@ void AbcExporter::operator()(float *progress, bool *was_canceled)
 
   for (; begin != end; ++begin) {
     *progress = (++i / size);
+    *do_update = 1;
 
     if (G.is_break) {
       *was_canceled = true;
diff --git a/source/blender/alembic/intern/abc_exporter.h b/source/blender/alembic/intern/abc_exporter.h
index cc8d9a75765..a73289fcf95 100644
--- a/source/blender/alembic/intern/abc_exporter.h
+++ b/source/blender/alembic/intern/abc_exporter.h
@@ -104,7 +104,7 @@ class AbcExporter {
   AbcExporter(Main *bmain, const char *filename, ExportSettings &settings);
   ~AbcExporter();
 
-  void operator()(float *progress, bool *was_canceled);
+  void operator()(short *do_update, float *progress, bool *was_canceled);
 
  protected:
   void getShutterSamples(unsigned int nr_of_samples,
diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index f9dc688c159..6547ce54a00 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -261,7 +261,7 @@ static void export_startjob(void *customdata, short *stop, short *do_update, flo
     const int orig_frame = CFRA;
 
     data->was_canceled = false;
-    exporter(progress, &data->was_canceled);
+    exporter(do_update, progress, &data->was_canceled);
 
     if (CFRA != orig_frame) {
       CFRA = orig_frame;



More information about the Bf-blender-cvs mailing list