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:
authorMonique Dewanchand <m.dewanchand@atmind.nl>2012-06-01 15:50:32 +0400
committerMonique Dewanchand <m.dewanchand@atmind.nl>2012-06-01 15:50:32 +0400
commit5fbeda7efd62e251dac2af881de9fe042f30a7a7 (patch)
tree573791adbcfc7725a841fc7e213494b80a8eeae2 /source/blender/compositor/nodes/COM_BlurNode.cpp
parent7941ebf66e15df1ca4b7b5439a5bbc90254479f4 (diff)
Optimize Gaussian blurs
Diffstat (limited to 'source/blender/compositor/nodes/COM_BlurNode.cpp')
-rw-r--r--source/blender/compositor/nodes/COM_BlurNode.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/compositor/nodes/COM_BlurNode.cpp b/source/blender/compositor/nodes/COM_BlurNode.cpp
index 90b2481cc7d..b209e36dd48 100644
--- a/source/blender/compositor/nodes/COM_BlurNode.cpp
+++ b/source/blender/compositor/nodes/COM_BlurNode.cpp
@@ -37,10 +37,11 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext * c
{
bNode *editorNode = this->getbNode();
NodeBlurData * data = (NodeBlurData*)editorNode->storage;
-#if 0
+ InputSocket * inputSizeSocket = this->getInputSocket(1);
+ bool connectedSizeSocket = inputSizeSocket->isConnected();
+
const bNodeSocket *sock = this->getInputSocket(1)->getbNodeSocket();
const float size = ((const bNodeSocketValueFloat*)sock->default_value)->value;
-#endif
CompositorQuality quality = context->getQuality();
@@ -71,6 +72,11 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext * c
addLink(graph, operationx->getOutputSocket(), operationy->getInputSocket(0));
addLink(graph, operationx->getInputSocket(1)->getConnection()->getFromSocket(), operationy->getInputSocket(1));
addPreviewOperation(graph, operationy->getOutputSocket(), 5);
+
+ if (!connectedSizeSocket) {
+ operationx->setSize(size);
+ operationy->setSize(size);
+ }
}
else {
GaussianBokehBlurOperation *operation = new GaussianBokehBlurOperation();
@@ -81,5 +87,9 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext * c
graph->addOperation(operation);
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket());
addPreviewOperation(graph, operation->getOutputSocket(), 5);
+
+ if (!connectedSizeSocket) {
+ operation->setSize(size);
+ }
}
}