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:
authorCampbell Barton <ideasman42@gmail.com>2012-08-14 18:31:39 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-14 18:31:39 +0400
commit9591142294fdcaded15663002e1f7bac568d7ed6 (patch)
tree52113a7107214478dc311733dae25f24410341ff /source/blender/compositor/nodes/COM_BokehBlurNode.cpp
parent59fedc6b7c315cbf95035d7add1cdb6384eb13e7 (diff)
add variable size option to bokeh blur node, remove f_stop option (it wasnt used), and add `blur_max` to the interface.
Diffstat (limited to 'source/blender/compositor/nodes/COM_BokehBlurNode.cpp')
-rw-r--r--source/blender/compositor/nodes/COM_BokehBlurNode.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/compositor/nodes/COM_BokehBlurNode.cpp b/source/blender/compositor/nodes/COM_BokehBlurNode.cpp
index 434fcf2a608..9abf97aa16f 100644
--- a/source/blender/compositor/nodes/COM_BokehBlurNode.cpp
+++ b/source/blender/compositor/nodes/COM_BokehBlurNode.cpp
@@ -36,10 +36,9 @@ BokehBlurNode::BokehBlurNode(bNode *editorNode) : Node(editorNode)
void BokehBlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
{
- InputSocket *inputSizeSocket = this->getInputSocket(2);
- bool connectedSizeSocket = inputSizeSocket->isConnected();
+ bNode *b_node = this->getbNode();
- if (connectedSizeSocket) {
+ if (b_node->custom1 & CMP_NODEFLAG_BLUR_VARIABLE_SIZE) {
VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation();
this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
@@ -51,13 +50,14 @@ void BokehBlurNode::convertToOperations(ExecutionSystem *graph, CompositorContex
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket());
operation->setThreshold(0.0f);
-
- /* TODO, we need to know the max input pixel of the input, this value is arbitrary! */
- operation->setMaxBlur(100.0f);
+ operation->setMaxBlur(b_node->custom4);
operation->setDoScaleSize(true);
}
else {
BokehBlurOperation *operation = new BokehBlurOperation();
+ InputSocket *inputSizeSocket = this->getInputSocket(2);
+
+ bool connectedSizeSocket = inputSizeSocket->isConnected();
const bNodeSocket *sock = this->getInputSocket(2)->getbNodeSocket();
const float size = ((const bNodeSocketValueFloat *)sock->default_value)->value;
@@ -72,6 +72,8 @@ void BokehBlurNode::convertToOperations(ExecutionSystem *graph, CompositorContex
graph->addOperation(operation);
this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket());
- operation->setSize(size);
+ if (!connectedSizeSocket) {
+ operation->setSize(size);
+ }
}
}