diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-14 18:31:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-14 18:31:39 +0400 |
commit | 9591142294fdcaded15663002e1f7bac568d7ed6 (patch) | |
tree | 52113a7107214478dc311733dae25f24410341ff /source/blender/compositor | |
parent | 59fedc6b7c315cbf95035d7add1cdb6384eb13e7 (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')
-rw-r--r-- | source/blender/compositor/intern/COM_Converter.cpp | 20 | ||||
-rw-r--r-- | source/blender/compositor/nodes/COM_BokehBlurNode.cpp | 16 |
2 files changed, 19 insertions, 17 deletions
diff --git a/source/blender/compositor/intern/COM_Converter.cpp b/source/blender/compositor/intern/COM_Converter.cpp index 24c3c36b79e..37b53c44ef7 100644 --- a/source/blender/compositor/intern/COM_Converter.cpp +++ b/source/blender/compositor/intern/COM_Converter.cpp @@ -129,16 +129,16 @@ Node *Converter::convert(bNode *b_node, bool fast) } if (fast) { if (b_node->type == CMP_NODE_BLUR || - b_node->type == CMP_NODE_VECBLUR || - b_node->type == CMP_NODE_BILATERALBLUR || - b_node->type == CMP_NODE_DEFOCUS || - b_node->type == CMP_NODE_BOKEHBLUR || - b_node->type == CMP_NODE_GLARE || - b_node->type == CMP_NODE_DBLUR || - b_node->type == CMP_NODE_MOVIEDISTORTION || - b_node->type == CMP_NODE_LENSDIST || - b_node->type == CMP_NODE_DOUBLEEDGEMASK || - b_node->type == CMP_NODE_DILATEERODE) + b_node->type == CMP_NODE_VECBLUR || + b_node->type == CMP_NODE_BILATERALBLUR || + b_node->type == CMP_NODE_DEFOCUS || + b_node->type == CMP_NODE_BOKEHBLUR || + b_node->type == CMP_NODE_GLARE || + b_node->type == CMP_NODE_DBLUR || + b_node->type == CMP_NODE_MOVIEDISTORTION || + b_node->type == CMP_NODE_LENSDIST || + b_node->type == CMP_NODE_DOUBLEEDGEMASK || + b_node->type == CMP_NODE_DILATEERODE) { return new MuteNode(b_node); } 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); + } } } |