Cycles: progress printing in background mode, print finished at the end and
avoid duplicate prints.
This commit is contained in:
@@ -76,6 +76,10 @@ void BlenderSession::create_session()
|
|||||||
SceneParams scene_params = BlenderSync::get_scene_params(b_scene);
|
SceneParams scene_params = BlenderSync::get_scene_params(b_scene);
|
||||||
SessionParams session_params = BlenderSync::get_session_params(b_scene, background);
|
SessionParams session_params = BlenderSync::get_session_params(b_scene, background);
|
||||||
|
|
||||||
|
/* reset status/progress */
|
||||||
|
last_status= "";
|
||||||
|
last_progress= -1.0f;
|
||||||
|
|
||||||
/* create scene */
|
/* create scene */
|
||||||
scene = new Scene(scene_params);
|
scene = new Scene(scene_params);
|
||||||
|
|
||||||
@@ -264,8 +268,14 @@ void BlenderSession::update_status_progress()
|
|||||||
if(substatus.size() > 0)
|
if(substatus.size() > 0)
|
||||||
status += " | " + substatus;
|
status += " | " + substatus;
|
||||||
|
|
||||||
RE_engine_update_stats((RenderEngine*)b_engine.ptr.data, "", status.c_str());
|
if(status != last_status) {
|
||||||
RE_engine_update_progress((RenderEngine*)b_engine.ptr.data, progress);
|
RE_engine_update_stats((RenderEngine*)b_engine.ptr.data, "", status.c_str());
|
||||||
|
last_status = status;
|
||||||
|
}
|
||||||
|
if(progress != last_progress) {
|
||||||
|
RE_engine_update_progress((RenderEngine*)b_engine.ptr.data, progress);
|
||||||
|
last_progress = progress;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlenderSession::tag_update()
|
void BlenderSession::tag_update()
|
||||||
|
@@ -70,6 +70,9 @@ public:
|
|||||||
BL::SpaceView3D b_v3d;
|
BL::SpaceView3D b_v3d;
|
||||||
BL::RegionView3D b_rv3d;
|
BL::RegionView3D b_rv3d;
|
||||||
|
|
||||||
|
string last_status;
|
||||||
|
float last_progress;
|
||||||
|
|
||||||
int width, height;
|
int width, height;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -170,8 +170,10 @@ void Session::run_gpu()
|
|||||||
|
|
||||||
if(params.background) {
|
if(params.background) {
|
||||||
/* if no work left and in background mode, we can stop immediately */
|
/* if no work left and in background mode, we can stop immediately */
|
||||||
if(no_tiles)
|
if(no_tiles) {
|
||||||
|
progress.set_status("Finished");
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* if in interactive mode, and we are either paused or done for now,
|
/* if in interactive mode, and we are either paused or done for now,
|
||||||
@@ -305,8 +307,10 @@ void Session::run_cpu()
|
|||||||
|
|
||||||
if(params.background) {
|
if(params.background) {
|
||||||
/* if no work left and in background mode, we can stop immediately */
|
/* if no work left and in background mode, we can stop immediately */
|
||||||
if(no_tiles)
|
if(no_tiles) {
|
||||||
|
progress.set_status("Finished");
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* if in interactive mode, and we are either paused or done for now,
|
/* if in interactive mode, and we are either paused or done for now,
|
||||||
|
Reference in New Issue
Block a user