Fix cycles "synchronizing object" status being shown when it was already finished.

This commit is contained in:
Brecht Van Lommel 2012-09-28 12:37:20 +00:00
parent 4cf06b97dd
commit 1d2e59ba1c
2 changed files with 41 additions and 3 deletions

@ -309,7 +309,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, int motion)
hide = hide || !(ob_layer & scene_layer); hide = hide || !(ob_layer & scene_layer);
if(!hide) { 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); 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) { if(!cancel && !motion) {
sync_background_light(); sync_background_light();

@ -43,6 +43,8 @@ public:
tile_time = 0.0f; tile_time = 0.0f;
status = "Initializing"; status = "Initializing";
substatus = ""; substatus = "";
sync_status = "";
sync_substatus = "";
update_cb = NULL; update_cb = NULL;
cancel = false; cancel = false;
cancel_message = ""; cancel_message = "";
@ -164,11 +166,42 @@ public:
set_update(); 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_) void get_status(string& status_, string& substatus_)
{ {
thread_scoped_lock lock(progress_mutex); 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 */ /* callback */
@ -202,6 +235,9 @@ protected:
string status; string status;
string substatus; string substatus;
string sync_status;
string sync_substatus;
volatile bool cancel; volatile bool cancel;
string cancel_message; string cancel_message;
}; };