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
This commit is contained in:
Manuel Castilla 2021-04-14 08:18:27 +02:00 committed by Jeroen Bakker
parent 6776b74d0a
commit a425b2b25c
5 changed files with 7 additions and 5 deletions

@ -1 +1 @@
Subproject commit 2cef4877edc40875978c4e95322bb5193f5815bf
Subproject commit f7b706dd6434db2d752f47c4b8c3148b2990fd73

@ -1 +1 @@
Subproject commit bcd08a9506d33bdd7358201031b04d041ef22d94
Subproject commit 1dbdb95ed93a8b96d12e42e17249f6e2cdd24619

@ -1 +1 @@
Subproject commit f948f658ba33eb670a65e0bba058d43138abea7e
Subproject commit 5523cbaed60719960f5f7b2486925145ecbe81e5

View File

@ -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);
}
}
}

@ -1 +1 @@
Subproject commit b66c22e1fb977bf8dd3797ebedc28fbe28f0305e
Subproject commit f1db70de64574921180b2c99519027d44d5350fc