Fix #34599: Mask nodes stop working if output is later piped through HSV node
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 12 Mar 2013 08:24:30 +0000 (08:24 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 12 Mar 2013 08:24:30 +0000 (08:24 +0000)
Issue was caused by the fix for #33650 which changed way to check whether
operation resolution is set or not from checking dimensions are zero to
setResolution was ever called.

Such change lead to conflict with MixBase operation (used for Mix node) which
uses temporary zero resolution to check whether input socket resolution is
known. This leads to zero resolution setting to that branch of tree. After this
resolution will never set to it's actual value.

For now solved by changing logic how MixBase operation detects resolution.
Namely instead of using trick with temporary zero resolution and calling
determineResolution for all inputs, and then call base class's method to
determine resolution just once again, check whether input socket is connected
and if so use it's resolution.

Shall not be regressions for real-life trees, but keeping an eye on this and
doing more tests is for sure welcome.

source/blender/compositor/operations/COM_MixBaseOperation.cpp

index 2d40629..5e3dbc2 100644 (file)
@@ -72,21 +72,11 @@ void MixBaseOperation::deinitExecution()
 
 void MixBaseOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
 {
-       InputSocket *socket;
-       unsigned int tempPreferredResolution[2] = {0, 0};
-       unsigned int tempResolution[2];
-       
-       socket = this->getInputSocket(1);
-       socket->determineResolution(tempResolution, tempPreferredResolution);
-       if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
+       if (this->getInputSocket(1)->isConnected()) {
                this->setResolutionInputSocketIndex(1);
        }
        else {
-               socket = this->getInputSocket(2);
-               tempPreferredResolution[0] = 0;
-               tempPreferredResolution[1] = 0;
-               socket->determineResolution(tempResolution, tempPreferredResolution);
-               if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
+               if (this->getInputSocket(2)->isConnected()) {
                        this->setResolutionInputSocketIndex(2);
                }
                else {