Fix #35369: Crop node or FileOutput node bug.

Issue was caused by file output node actually,

The thing here is, compositor output does have fixed
resolution and we could predict how to map coordinates
for border and cropping in that case.

But viewers and file output nodes are currently totally
depending on an input resolution. Could not see how
border could be applied reliably in this cases.

Disabling border option for file output node, so
now it shall behave the same way as it was before.

Discovered issues when using cropping to render border,
namely there's an offset in viewer nodes and previews,
but this is separate issue i guess (file output seems
to work fine). Will revisit this issue in next days.
This commit is contained in:
Sergey Sharybin
2013-05-17 13:02:03 +00:00
parent 88d1067f58
commit 27baa34ba4
3 changed files with 27 additions and 3 deletions

View File

@@ -638,8 +638,27 @@ void ExecutionGroup::setRenderBorder(float xmin, float xmax, float ymin, float y
{
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);
if (operation->isOutputOperation(true)) {
/* Basically, setting border need to happen for only operatoins
* which operates in render resolution buffers (like compositor
* output nodes).
*
* In this cases adding border will lead to mapping coordinates
* from output buffer space to input buffer spaces when executing
* operation.
*
* But nodes like viewer and file output just shall display or
* safe the same exact buffer which goes to their input, no need
* in any kind of coordinates mapping.
*/
bool operationNeedsBorder = !(operation->isViewerOperation() ||
operation->isPreviewOperation() ||
operation->isFileOutputOperation());
if (operationNeedsBorder) {
BLI_rcti_init(&this->m_viewerBorder, xmin * this->m_width, xmax * this->m_width,
ymin * this->m_height, ymax * this->m_height);
}
}
}

View File

@@ -247,6 +247,7 @@ public:
virtual bool isViewerOperation() { return false; }
virtual bool isPreviewOperation() { return false; }
virtual bool isFileOutputOperation() { return false; }
inline bool isBreaked() {
return this->m_btree->test_break(this->m_btree->tbh);

View File

@@ -56,6 +56,8 @@ public:
void initExecution();
void deinitExecution();
const CompositorPriority getRenderPriority() const { return COM_PRIORITY_LOW; }
bool isFileOutputOperation() { return true; }
};
/* extra info for OpenEXR layers */
@@ -90,6 +92,8 @@ public:
void initExecution();
void deinitExecution();
const CompositorPriority getRenderPriority() const { return COM_PRIORITY_LOW; }
bool isFileOutputOperation() { return true; }
};
#endif