diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2013-06-30 17:35:00 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2013-06-30 17:35:00 +0400 |
commit | d492a9ffa93f2fcffeae2b6f883d8835c0eeec8a (patch) | |
tree | 78037c9c3a4a1fb3adabe77b1e77d1777b866d68 /source/blender/compositor | |
parent | 5ae37494f63fd68e647028525ab0906c2ddce0ba (diff) |
Fix for
* [#35922] RGB Input Node doesn't work properly
Diffstat (limited to 'source/blender/compositor')
3 files changed, 27 insertions, 10 deletions
diff --git a/source/blender/compositor/nodes/COM_MixNode.cpp b/source/blender/compositor/nodes/COM_MixNode.cpp index 3e8f1fb0f74..ab4e464327d 100644 --- a/source/blender/compositor/nodes/COM_MixNode.cpp +++ b/source/blender/compositor/nodes/COM_MixNode.cpp @@ -124,16 +124,6 @@ void MixNode::convertToOperations(ExecutionSystem *graph, CompositorContext *con convertProg->setUseValueAlphaMultiply(useAlphaPremultiply); convertProg->setUseClamp(useClamp); - if (color1Socket->isConnected()) { - convertProg->setResolutionInputSocketIndex(1); - } - else { - if (color2Socket->isConnected()) - convertProg->setResolutionInputSocketIndex(2); - else - convertProg->setResolutionInputSocketIndex(0); - } - valueSocket->relinkConnections(convertProg->getInputSocket(0), 0, graph); color1Socket->relinkConnections(convertProg->getInputSocket(1), 1, graph); color2Socket->relinkConnections(convertProg->getInputSocket(2), 2, graph); diff --git a/source/blender/compositor/operations/COM_MixBaseOperation.cpp b/source/blender/compositor/operations/COM_MixBaseOperation.cpp index 438fb84ebb7..5b455338bb0 100644 --- a/source/blender/compositor/operations/COM_MixBaseOperation.cpp +++ b/source/blender/compositor/operations/COM_MixBaseOperation.cpp @@ -63,6 +63,30 @@ void MixBaseOperation::executePixel(float output[4], float x, float y, PixelSamp output[3] = inputColor1[3]; } +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)) { + this->setResolutionInputSocketIndex(1); + } + else { + socket = this->getInputSocket(2); + socket->determineResolution(tempResolution, tempPreferredResolution); + if ((tempResolution[0] != 0) && (tempResolution[1] != 0)) { + this->setResolutionInputSocketIndex(2); + } + else { + this->setResolutionInputSocketIndex(0); + } + } + NodeOperation::determineResolution(resolution, preferredResolution); +} + void MixBaseOperation::deinitExecution() { this->m_inputValueOperation = NULL; diff --git a/source/blender/compositor/operations/COM_MixBaseOperation.h b/source/blender/compositor/operations/COM_MixBaseOperation.h index 75ca1c3f6c6..3c0c0778190 100644 --- a/source/blender/compositor/operations/COM_MixBaseOperation.h +++ b/source/blender/compositor/operations/COM_MixBaseOperation.h @@ -70,6 +70,9 @@ public: * Deinitialize the execution */ void deinitExecution(); + + void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); + void setUseValueAlphaMultiply(const bool value) { this->m_valueAlphaMultiply = value; } bool useValueAlphaMultiply() { return this->m_valueAlphaMultiply; } |