Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-08-22 17:17:43 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-08-22 17:17:43 +0400
commit9ccc60ed8c22ad7ce886273832dd885af3c2347d (patch)
tree7bd921e04cb8a39286f57d058836c88a8c10fc4a /intern/cycles/blender/blender_session.cpp
parentf7b9c85871ad4e68dbd578556f3ae8ef55d6dc98 (diff)
Cycles:
* Update progress bar during render (patch by Thomas) * Show status/pass/time during render in 3d view
Diffstat (limited to 'intern/cycles/blender/blender_session.cpp')
-rw-r--r--intern/cycles/blender/blender_session.cpp35
1 files changed, 28 insertions, 7 deletions
diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp
index f69ebff5338..045efef0ef0 100644
--- a/intern/cycles/blender/blender_session.cpp
+++ b/intern/cycles/blender/blender_session.cpp
@@ -243,6 +243,15 @@ void BlenderSession::get_status(string& status, string& substatus)
session->progress.get_status(status, substatus);
}
+void BlenderSession::get_progress(float& progress, double& total_time)
+{
+ double pass_time;
+ int pass;
+
+ session->progress.get_pass(pass, total_time, pass_time);
+ progress = ((float)pass/(float)session->params.passes);
+}
+
void BlenderSession::tag_update()
{
/* tell blender that we want to get another update callback */
@@ -251,16 +260,28 @@ void BlenderSession::tag_update()
void BlenderSession::tag_redraw()
{
- if(background) {
- /* offline render, set stats and redraw if timeout passed */
- string status, substatus;
- get_status(status, substatus);
+ string status, substatus;
+ float progress;
+ double total_time;
+ char time_str[128];
+
+ /* update stats and progress */
+ get_status(status, substatus);
+ get_progress(progress, total_time);
+
+ if(!background) {
+ BLI_timestr(total_time, time_str);
+ status = "Time: " + string(time_str) + " | " + status;
+ }
- if(substatus.size() > 0)
- status += " | " + substatus;
+ if(substatus.size() > 0)
+ status += " | " + substatus;
- RE_engine_update_stats((RenderEngine*)b_engine.ptr.data, "", status.c_str());
+ RE_engine_update_stats((RenderEngine*)b_engine.ptr.data, "", status.c_str());
+ RE_engine_update_progress((RenderEngine*)b_engine.ptr.data, progress);
+ if(background) {
+ /* offline render, redraw if timeout passed */
if(time_dt() - last_redraw_time > 1.0f) {
write_render_result();
engine_tag_redraw((RenderEngine*)b_engine.ptr.data);