Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-07-10 14:36:18 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-07-10 14:36:18 +0400
commit5b57f38fb5e324f8365e135bb0abc2b5e8c57953 (patch)
treec7195f3172509870a9d9a0f691b8db1cb50717e5 /source/blender/compositor/nodes
parenta158cb4e692f782d7efb92cdcfd0597c51283af8 (diff)
parent6b75a99c0101d8bfec29ed432a341b9cae078e20 (diff)
Mango request: option to clamp result of Mix RGB and Color Math nodes
--- Merging r48792 from soc-2011-tomato into trunk
Diffstat (limited to 'source/blender/compositor/nodes')
-rw-r--r--source/blender/compositor/nodes/COM_MathNode.cpp6
-rw-r--r--source/blender/compositor/nodes/COM_MixNode.cpp5
2 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/compositor/nodes/COM_MathNode.cpp b/source/blender/compositor/nodes/COM_MathNode.cpp
index 300c9967cc4..307590b977b 100644
--- a/source/blender/compositor/nodes/COM_MathNode.cpp
+++ b/source/blender/compositor/nodes/COM_MathNode.cpp
@@ -83,10 +83,14 @@ void MathNode::convertToOperations(ExecutionSystem *graph, CompositorContext *co
}
if (operation != NULL) {
+ bool useClamp = this->getbNode()->custom2;
+
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph);
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket());
-
+
+ operation->setUseClamp(useClamp);
+
graph->addOperation(operation);
}
}
diff --git a/source/blender/compositor/nodes/COM_MixNode.cpp b/source/blender/compositor/nodes/COM_MixNode.cpp
index eb62ebd2635..7aeaaf56c98 100644
--- a/source/blender/compositor/nodes/COM_MixNode.cpp
+++ b/source/blender/compositor/nodes/COM_MixNode.cpp
@@ -58,6 +58,8 @@ void MixNode::convertToOperations(ExecutionSystem *graph, CompositorContext *con
InputSocket *color2Socket = this->getInputSocket(2);
OutputSocket *outputSocket = this->getOutputSocket(0);
bNode *editorNode = this->getbNode();
+ bool useAlphaPremultiply = this->getbNode()->custom2 & 1;
+ bool useClamp = this->getbNode()->custom2 & 2;
MixBaseOperation *convertProg;
@@ -119,7 +121,8 @@ void MixNode::convertToOperations(ExecutionSystem *graph, CompositorContext *con
convertProg = new MixBlendOperation();
break;
}
- convertProg->setUseValueAlphaMultiply(this->getbNode()->custom2);
+ convertProg->setUseValueAlphaMultiply(useAlphaPremultiply);
+ convertProg->setUseClamp(useClamp);
valueSocket->relinkConnections(convertProg->getInputSocket(0), 0, graph);
color1Socket->relinkConnections(convertProg->getInputSocket(1), 1, graph);