From 13714e621d654f64a2b8c6f2772ffcb0ab101dd2 Mon Sep 17 00:00:00 2001 From: Monique Dewanchand Date: Thu, 31 May 2012 20:26:42 +0000 Subject: Fix for [#31662] Compositing: No Alpha if image/color connected to second input of math node --- .../compositor/operations/COM_MathBaseOperation.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source/blender/compositor/operations/COM_MathBaseOperation.cpp') diff --git a/source/blender/compositor/operations/COM_MathBaseOperation.cpp b/source/blender/compositor/operations/COM_MathBaseOperation.cpp index 3a287cb7239..2ea5f85253b 100644 --- a/source/blender/compositor/operations/COM_MathBaseOperation.cpp +++ b/source/blender/compositor/operations/COM_MathBaseOperation.cpp @@ -47,6 +47,22 @@ void MathBaseOperation::deinitExecution() 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]; -- cgit v1.2.3