From ca9615931a5834b3f8b7e0e8de31c9f4e122ee91 Mon Sep 17 00:00:00 2001 From: murraystevenson <50844517+murraystevenson@users.noreply.github.com> Date: Sat, 26 Oct 2019 13:23:50 -0700 Subject: [PATCH] Update Renderer.cpp crop window support for interactive and local renders --- src/GafferCycles/IECoreCyclesPreview/Renderer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/GafferCycles/IECoreCyclesPreview/Renderer.cpp b/src/GafferCycles/IECoreCyclesPreview/Renderer.cpp index bd05b7b..43b17aa 100644 --- a/src/GafferCycles/IECoreCyclesPreview/Renderer.cpp +++ b/src/GafferCycles/IECoreCyclesPreview/Renderer.cpp @@ -389,8 +389,8 @@ class CyclesOutput : public IECore::RefCounted V2i( camera->width - 1, camera->height - 1 ) ); Box2i dataWindow( - V2i( 0, 0 ), - V2i( camera->width - 1, camera->height - 1 ) + V2i( (int)(camera->border.left * (float)camera->width), (int)(camera->border.bottom * (float)camera->height) ), + V2i( (int)(camera->border.right * (float)camera->width) - 1, (int)(camera->border.top * (float)camera->height - 1 ) ) ); vector channelNames; @@ -499,8 +499,8 @@ class RenderCallback : public IECore::RefCounted V2i( camera->width - 1, camera->height - 1 ) ); Box2i dataWindow( - V2i( 0, 0 ), - V2i( camera->width - 1, camera->height - 1 ) + V2i( (int)(camera->border.left * (float)camera->width), (int)(camera->border.bottom * (float)camera->height) ), + V2i( (int)(camera->border.right * (float)camera->width) - 1, (int)(camera->border.top * (float)camera->height - 1 ) ) ); //CompoundDataPtr parameters = new CompoundData(); @@ -618,8 +618,8 @@ class RenderCallback : public IECore::RefCounted IECore::msg( IECore::Msg::Warning, "CyclesRenderer::CyclesOutput", "No interactive outputs to render to." ); return; } - const int x = rtile.x - m_session->tile_manager.params.full_x; - const int y = rtile.y - m_session->tile_manager.params.full_y; + const int x = rtile.x; + const int y = rtile.y; const int w = rtile.w; const int h = rtile.h;