diff options
author | Manuel Castilla <manzanilla> | 2021-04-14 09:18:27 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-04-14 09:18:44 +0300 |
commit | a425b2b25c0f7ba44e9732633e648338270c4483 (patch) | |
tree | a5bc6bf1d8c200d012db4232aa3f52786b0185a5 /source/blender/compositor/intern | |
parent | 6776b74d0a6720d233efa459fa238aa57eb84a76 (diff) |
Fix (unreported) compositor resolution propagation broken by some nodes
Some operations may use no preferredResolution ({0, 0}) when calling determineResolution on inputs to check if they have resolution on their own. See MixOperation or MathOperation determineResolution implementation. In such cases {0, 0} resolution ends up being set when an input doesn't have own resolution, breaking propagation of the original preferredResolution. They don't mean to set it as resolution, it's just a check.
This patch only allows to set valid resolutions (>0). When it's 0 it may be understood as "No preferred or determined resolution" so it should not be set to give output operations another chance of finding a proper resolution by calling determineResolution again with a different preferredResolution.
Test file:
{F9932526}
Reviewed By: #compositing, jbakker
Differential Revision: https://developer.blender.org/D10972
Diffstat (limited to 'source/blender/compositor/intern')
-rw-r--r-- | source/blender/compositor/intern/COM_NodeOperation.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/compositor/intern/COM_NodeOperation.cc b/source/blender/compositor/intern/COM_NodeOperation.cc index 0bb8e0ef674..be3ea59efa5 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.cc +++ b/source/blender/compositor/intern/COM_NodeOperation.cc @@ -220,7 +220,9 @@ void NodeOperationOutput::determineResolution(unsigned int resolution[2], } else { operation.determineResolution(resolution, preferredResolution); - operation.setResolution(resolution); + if (resolution[0] > 0 && resolution[1] > 0) { + operation.setResolution(resolution); + } } } |