[Bf-blender-cvs] [e9f2f17e851] master: Fix (unreported): TextureOperation inputs have no resolution

Manuel Castilla noreply at git.blender.org
Mon May 31 12:32:25 CEST 2021


Commit: e9f2f17e8518f31706756b4ebe7c38a3582a3612
Author: Manuel Castilla
Date:   Mon May 31 12:26:46 2021 +0200
Branches: master
https://developer.blender.org/rBe9f2f17e8518f31706756b4ebe7c38a3582a3612

Fix (unreported): TextureOperation inputs have no resolution

When compositor node tree has a texture node, TextureOperation vector inputs  has always {0, 0} resolution instead of having same resolution as TextureOperation which is the expected behaviour for resolutions propagation.

Current TextureOperation determineResolution implementation doesn't determine inputs resolution, breaking propagation of preferred resolution and that's the reason why they are always 0. Setting scene resolution always would mean it is its own resolution and could make sense, but setting it only when preferred resolution is 0, breaks preferred resolution logic affecting other operations as explained in D10972. In any case scene resolution is already the default preferred resolution on vie [...]

Reviewed By: jbakker

Differential Revision: https://developer.blender.org/D11381

===================================================================

M	source/blender/compositor/operations/COM_TextureOperation.cc
M	source/blender/compositor/operations/COM_TextureOperation.h

===================================================================

diff --git a/source/blender/compositor/operations/COM_TextureOperation.cc b/source/blender/compositor/operations/COM_TextureOperation.cc
index e94c457f981..7517ff8a137 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.cc
+++ b/source/blender/compositor/operations/COM_TextureOperation.cc
@@ -75,16 +75,13 @@ void TextureBaseOperation::deinitExecution()
 void TextureBaseOperation::determineResolution(unsigned int resolution[2],
                                                unsigned int preferredResolution[2])
 {
-  if (preferredResolution[0] == 0 || preferredResolution[1] == 0) {
-    int width = this->m_rd->xsch * this->m_rd->size / 100;
-    int height = this->m_rd->ysch * this->m_rd->size / 100;
-    resolution[0] = width;
-    resolution[1] = height;
-  }
-  else {
-    resolution[0] = preferredResolution[0];
-    resolution[1] = preferredResolution[1];
-  }
+  /* Determine inputs resolutions. */
+  unsigned int temp[2];
+  NodeOperation::determineResolution(temp, preferredResolution);
+
+  /* We don't use inputs resolutions because they are only used as parameters, not image data. */
+  resolution[0] = preferredResolution[0];
+  resolution[1] = preferredResolution[1];
 }
 
 void TextureAlphaOperation::executePixelSampled(float output[4],
diff --git a/source/blender/compositor/operations/COM_TextureOperation.h b/source/blender/compositor/operations/COM_TextureOperation.h
index e1e04611c6c..e5f56673694 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.h
+++ b/source/blender/compositor/operations/COM_TextureOperation.h
@@ -44,7 +44,7 @@ class TextureBaseOperation : public NodeOperation {
 
  protected:
   /**
-   * Determine the output resolution. The resolution is retrieved from the Renderer
+   * Determine the output resolution.
    */
   void determineResolution(unsigned int resolution[2],
                            unsigned int preferredResolution[2]) override;



More information about the Bf-blender-cvs mailing list