Revision: 47297
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47297
Author:   mdewanchand
Date:     2012-05-31 20:26:42 +0000 (Thu, 31 May 2012)
Log Message:
-----------
Fix for [#31662] Compositing: No Alpha if image/color connected to second input 
of math node

Modified Paths:
--------------
    trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.cpp
    trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.h

Modified: 
trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.cpp
===================================================================
--- 
trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.cpp    
    2012-05-31 20:26:36 UTC (rev 47296)
+++ 
trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.cpp    
    2012-05-31 20:26:42 UTC (rev 47297)
@@ -47,6 +47,22 @@
        this->inputValue2Operation = NULL;
 }
 
+void MathBaseOperation::determineResolution(unsigned int resolution[], 
unsigned int preferredResolution[])
+{
+       InputSocket *socket;
+       unsigned int tempPreferredResolution[] = {0,0};
+       unsigned int tempResolution[2];
+
+       socket = this->getInputSocket(0);
+       socket->determineResolution(tempResolution, tempPreferredResolution);
+       if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) {
+               this->setResolutionInputSocketIndex(0);
+       } else {
+               this->setResolutionInputSocketIndex(1);
+       }
+       NodeOperation::determineResolution(resolution, preferredResolution);
+}
+
 void MathAddOperation::executePixel(float *outputValue, float x, float y, 
PixelSampler sampler, MemoryBuffer *inputBuffers[])
 {
        float inputValue1[4];

Modified: 
trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.h
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.h  
2012-05-31 20:26:36 UTC (rev 47296)
+++ trunk/blender/source/blender/compositor/operations/COM_MathBaseOperation.h  
2012-05-31 20:26:42 UTC (rev 47297)
@@ -58,6 +58,10 @@
          */
        void deinitExecution();
 
+       /**
+         * Determine resolution
+         */
+       void determineResolution(unsigned int resolution[], unsigned int 
preferredResolution[]);
 };
 
 class MathAddOperation: public MathBaseOperation {

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to