diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-09-28 16:37:20 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-09-28 16:37:20 +0400 |
commit | 1d2e59ba1c7cc3f823ad6e3916ebee28b4a069b1 (patch) | |
tree | 6183b340d1953ee887cb7b7846235fb7807152f9 | |
parent | 4cf06b97ddcd0204a35969b0521154bcdd7a9cd8 (diff) |
Fix cycles "synchronizing object" status being shown when it was already finished.
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/util/util_progress.h | 40 |
2 files changed, 41 insertions, 3 deletions
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index eb9deb0de2d..8fbb223cbc5 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -309,7 +309,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion) hide = hide || !(ob_layer & scene_layer); if(!hide) { - progress.set_status("Synchronizing object", (*b_ob).name()); + progress.set_sync_status("Synchronizing object", (*b_ob).name()); int num_particles = object_count_particles(*b_ob); @@ -356,6 +356,8 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion) } } + progress.set_sync_status(""); + if(!cancel && !motion) { sync_background_light(); diff --git a/intern/cycles/util/util_progress.h b/intern/cycles/util/util_progress.h index ab9ab7243e9..c97379d8776 100644 --- a/intern/cycles/util/util_progress.h +++ b/intern/cycles/util/util_progress.h @@ -43,6 +43,8 @@ public: tile_time = 0.0f; status = "Initializing"; substatus = ""; + sync_status = ""; + sync_substatus = ""; update_cb = NULL; cancel = false; cancel_message = ""; @@ -164,11 +166,42 @@ public: set_update(); } + void set_sync_status(const string& status_, const string& substatus_ = "") + { + { + thread_scoped_lock lock(progress_mutex); + sync_status = status_; + sync_substatus = substatus_; + total_time = time_dt() - start_time; + } + + set_update(); + + } + + void set_sync_substatus(const string& substatus_) + { + { + thread_scoped_lock lock(progress_mutex); + sync_substatus = substatus_; + total_time = time_dt() - start_time; + } + + set_update(); + } + void get_status(string& status_, string& substatus_) { thread_scoped_lock lock(progress_mutex); - status_ = status; - substatus_ = substatus; + + if(sync_status != "") { + status_ = sync_status; + substatus_ = sync_substatus; + } + else { + status_ = status; + substatus_ = substatus; + } } /* callback */ @@ -202,6 +235,9 @@ protected: string status; string substatus; + string sync_status; + string sync_substatus; + volatile bool cancel; string cancel_message; }; |