diff options
Diffstat (limited to 'source/blender/compositor/intern')
6 files changed, 29 insertions, 1 deletions
diff --git a/source/blender/compositor/intern/COM_Converter.cpp b/source/blender/compositor/intern/COM_Converter.cpp index 80f5b4fc149..80ae952b87f 100644 --- a/source/blender/compositor/intern/COM_Converter.cpp +++ b/source/blender/compositor/intern/COM_Converter.cpp @@ -403,6 +403,7 @@ Node *Converter::convert(bNode *b_node, bool fast) node = new PixelateNode(b_node); break; default: + node = new MuteNode(b_node); break; } return node; diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp index 14fd7e0b6cf..82d1c7883e1 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp +++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp @@ -633,3 +633,13 @@ void ExecutionGroup::setViewerBorder(float xmin, float xmax, float ymin, float y ymin * this->m_height, ymax * this->m_height); } } + +void ExecutionGroup::setRenderBorder(float xmin, float xmax, float ymin, float ymax) +{ + NodeOperation *operation = this->getOutputNodeOperation(); + + if (operation->isOutputOperation(true) && !(operation->isViewerOperation() || operation->isPreviewOperation())) { + BLI_rcti_init(&this->m_viewerBorder, xmin * this->m_width, xmax * this->m_width, + ymin * this->m_height, ymax * this->m_height); + } +} diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.h b/source/blender/compositor/intern/COM_ExecutionGroup.h index b5f02e05be1..537dcb5974a 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.h +++ b/source/blender/compositor/intern/COM_ExecutionGroup.h @@ -417,6 +417,8 @@ public: */ void setViewerBorder(float xmin, float xmax, float ymin, float ymax); + void setRenderBorder(float xmin, float xmax, float ymin, float ymax); + #ifdef WITH_CXX_GUARDEDALLOC MEM_CXX_CLASS_ALLOC_FUNCS("COM:ExecutionGroup") #endif diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cpp b/source/blender/compositor/intern/COM_ExecutionSystem.cpp index 2d87845d254..450d1b03917 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.cpp +++ b/source/blender/compositor/intern/COM_ExecutionSystem.cpp @@ -95,6 +95,16 @@ ExecutionSystem::ExecutionSystem(RenderData *rd, bNodeTree *editingtree, bool re ExecutionGroup *executionGroup = this->m_groups[index]; executionGroup->determineResolution(resolution); + if (rendering) { + /* case when cropping to render border happens is handled in + * compositor output and render layer nodes + */ + if ((rd->mode & R_BORDER) && !(rd->mode & R_CROP)) { + executionGroup->setRenderBorder(rd->border.xmin, rd->border.xmax, + rd->border.ymin, rd->border.ymax); + } + } + if (use_viewer_border) { executionGroup->setViewerBorder(viewer_border->xmin, viewer_border->xmax, viewer_border->ymin, viewer_border->ymax); diff --git a/source/blender/compositor/intern/COM_NodeOperation.h b/source/blender/compositor/intern/COM_NodeOperation.h index 60ffadf60f7..26a382929cb 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.h +++ b/source/blender/compositor/intern/COM_NodeOperation.h @@ -81,6 +81,9 @@ private: */ const bNodeTree *m_btree; + /** + * @brief set to truth when resolution for this operation is set + */ bool m_isResolutionSet; public: /** diff --git a/source/blender/compositor/intern/COM_compositor.cpp b/source/blender/compositor/intern/COM_compositor.cpp index 94a27e17b68..a0f660058f9 100644 --- a/source/blender/compositor/intern/COM_compositor.cpp +++ b/source/blender/compositor/intern/COM_compositor.cpp @@ -65,8 +65,10 @@ void COM_execute(RenderData *rd, bNodeTree *editingtree, int rendering, /* Make sure node tree has previews. * Don't create previews in advance, this is done when adding preview operations. + * Reserved preview size is determined by render output for now. */ - BKE_node_preview_init_tree(editingtree, COM_PREVIEW_SIZE, COM_PREVIEW_SIZE, FALSE); + float aspect = rd->xsch > 0 ? (float)rd->ysch / (float)rd->xsch : 1.0; + BKE_node_preview_init_tree(editingtree, COM_PREVIEW_SIZE, (int)(COM_PREVIEW_SIZE * aspect), FALSE); /* initialize workscheduler, will check if already done. TODO deinitialize somewhere */ bool use_opencl = (editingtree->flag & NTREE_COM_OPENCL); |