diff options
Diffstat (limited to 'intern/cycles/blender/blender_session.cpp')
-rw-r--r-- | intern/cycles/blender/blender_session.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index 997909f1b92..12d7d00fb61 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -83,8 +83,8 @@ void BlenderSession::create_session() SessionParams session_params = BlenderSync::get_session_params(b_userpref, b_scene, background); /* reset status/progress */ - last_status= ""; - last_progress= -1.0f; + last_status = ""; + last_progress = -1.0f; /* create scene */ scene = new Scene(scene_params); @@ -106,7 +106,7 @@ void BlenderSession::create_session() session->set_pause(BlenderSync::get_session_pause(b_scene, background)); /* set buffer parameters */ - BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, b_rv3d, width, height); + BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, scene->camera, width, height); session->reset(buffer_params, session_params.samples); } @@ -181,7 +181,7 @@ void BlenderSession::render() { /* get buffer parameters */ SessionParams session_params = BlenderSync::get_session_params(b_userpref, b_scene, background); - BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, b_rv3d, width, height); + BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, scene->camera, width, height); int w = buffer_params.width, h = buffer_params.height; /* create render result */ @@ -292,7 +292,8 @@ void BlenderSession::synchronize() SessionParams session_params = BlenderSync::get_session_params(b_userpref, b_scene, background); if(session->params.modified(session_params) || - scene->params.modified(scene_params)) { + scene->params.modified(scene_params)) + { free_session(); create_session(); session->start(); @@ -304,7 +305,7 @@ void BlenderSession::synchronize() session->set_pause(BlenderSync::get_session_pause(b_scene, background)); /* copy recalc flags, outside of mutex so we can decide to do the real - synchronization at a later time to not block on running updates */ + * synchronization at a later time to not block on running updates */ sync->sync_recalc(); /* try to acquire mutex. if we don't want to or can't, come back later */ @@ -326,7 +327,7 @@ void BlenderSession::synchronize() /* reset if needed */ if(scene->need_reset()) { - BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, b_rv3d, width, height); + BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, scene->camera, width, height); session->reset(buffer_params, session_params.samples); } } @@ -334,7 +335,7 @@ void BlenderSession::synchronize() bool BlenderSession::draw(int w, int h) { /* before drawing, we verify camera and viewport size changes, because - we do not get update callbacks for those, we must detect them here */ + * we do not get update callbacks for those, we must detect them here */ if(session->ready_to_reset()) { bool reset = false; @@ -364,7 +365,7 @@ bool BlenderSession::draw(int w, int h) /* reset if requested */ if(reset) { SessionParams session_params = BlenderSync::get_session_params(b_userpref, b_scene, background); - BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, b_rv3d, width, height); + BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, scene->camera, w, h); session->reset(buffer_params, session_params.samples); } @@ -374,7 +375,7 @@ bool BlenderSession::draw(int w, int h) update_status_progress(); /* draw */ - BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, b_rv3d, width, height); + BufferParams buffer_params = BlenderSync::get_buffer_params(b_scene, scene->camera, width, height); return !session->draw(buffer_params); } @@ -429,11 +430,11 @@ void BlenderSession::tag_redraw() { if(background) { /* update stats and progress, only for background here because - in 3d view we do it in draw for thread safety reasons */ + * in 3d view we do it in draw for thread safety reasons */ update_status_progress(); /* offline render, redraw if timeout passed */ - if(time_dt() - last_redraw_time > 1.0f) { + if(time_dt() - last_redraw_time > 1.0) { write_render_result(); engine_tag_redraw((RenderEngine*)b_engine.ptr.data); last_redraw_time = time_dt(); |