diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-19 15:05:18 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-19 15:05:18 +0400 |
commit | a56f4fee38e17d05964941a5edc2850c217309d7 (patch) | |
tree | e4430faf6ff15aa037f6d8fb1ede5f0afac6a376 /source/blender/compositor/nodes/COM_BlurNode.cpp | |
parent | 9c8edae7d4ef799b19f6487feb21ce7fbcf5ee07 (diff) |
Fix for
* [#32040] size-input of a blur-node is uniform for the whole picture
* [#32062] Blur node Size input is not working with
* [#32140] Blur Node using a greyscale input as size multiplier fails
to work
Node now has a new option (new compositor cannot detect if the connected
part is a single value, or an image connected).
With this option the use of a reference image to multiply the size of
the blur per pixel can be enabled/disabled.
Regards,
Jeroen
- At Mind -
Diffstat (limited to 'source/blender/compositor/nodes/COM_BlurNode.cpp')
-rw-r--r-- | source/blender/compositor/nodes/COM_BlurNode.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/source/blender/compositor/nodes/COM_BlurNode.cpp b/source/blender/compositor/nodes/COM_BlurNode.cpp index 5447652c238..9b945887ec2 100644 --- a/source/blender/compositor/nodes/COM_BlurNode.cpp +++ b/source/blender/compositor/nodes/COM_BlurNode.cpp @@ -25,9 +25,13 @@ #include "DNA_node_types.h" #include "COM_GaussianXBlurOperation.h" #include "COM_GaussianYBlurOperation.h" +#include "COM_GaussianAlphaXBlurOperation.h" +#include "COM_GaussianAlphaYBlurOperation.h" #include "COM_ExecutionSystem.h" #include "COM_GaussianBokehBlurOperation.h" #include "COM_FastGaussianBlurOperation.h" +#include "COM_MathBaseOperation.h" +#include "COM_SetValueOperation.h" BlurNode::BlurNode(bNode *editorNode) : Node(editorNode) { @@ -56,6 +60,42 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext *co graph->addOperation(operationfgb); addPreviewOperation(graph, operationfgb->getOutputSocket()); } + else if (editorNode->custom1 & CMP_NODEFLAG_BLUR_REFERENCE) { + MathAddOperation *clamp = new MathAddOperation(); + SetValueOperation *zero = new SetValueOperation(); + addLink(graph, zero->getOutputSocket(), clamp->getInputSocket(1)); + this->getInputSocket(1)->relinkConnections(clamp->getInputSocket(0), 1, graph); + zero->setValue(0.0f); + clamp->setUseClamp(true); + graph->addOperation(clamp); + graph->addOperation(zero); + + GaussianAlphaXBlurOperation *operationx = new GaussianAlphaXBlurOperation(); + operationx->setData(data); + operationx->setbNode(editorNode); + operationx->setQuality(quality); + operationx->setSize(1.0f); + addLink(graph, clamp->getOutputSocket(), operationx->getInputSocket(0)); + graph->addOperation(operationx); + + GaussianYBlurOperation *operationy = new GaussianYBlurOperation(); + operationy->setData(data); + operationy->setbNode(editorNode); + operationy->setQuality(quality); + operationy->setSize(1.0f); + addLink(graph, operationx->getOutputSocket(), operationy->getInputSocket(0)); + graph->addOperation(operationy); + + GaussianBlurReferenceOperation *operation = new GaussianBlurReferenceOperation(); + operation->setData(data); + operation->setbNode(editorNode); + operation->setQuality(quality); + this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); + addLink(graph, operationy->getOutputSocket(), operation->getInputSocket(1)); + graph->addOperation(operation); + this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket()); + addPreviewOperation(graph, operation->getOutputSocket()); + } else if (!data->bokeh) { GaussianXBlurOperation *operationx = new GaussianXBlurOperation(); operationx->setData(data); |