diff options
author | Monique Dewanchand <m.dewanchand@atmind.nl> | 2012-07-11 00:21:13 +0400 |
---|---|---|
committer | Monique Dewanchand <m.dewanchand@atmind.nl> | 2012-07-11 00:21:13 +0400 |
commit | 8a4584d04daae39c76d1f46200a57d8f4f3c9d40 (patch) | |
tree | c869a5bdce291a11f824efae7e3c0b418df6529d /source/blender/compositor/nodes/COM_BokehBlurNode.cpp | |
parent | 831ae18622971c9d3be878d0e44db77217e605ad (diff) |
Fix for tiles bug:
[#31981] Bokeh Blur Node - Size input socket does not accept input from Value Input node, Values smaller than 0.1 will produce black output
Diffstat (limited to 'source/blender/compositor/nodes/COM_BokehBlurNode.cpp')
-rw-r--r-- | source/blender/compositor/nodes/COM_BokehBlurNode.cpp | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/source/blender/compositor/nodes/COM_BokehBlurNode.cpp b/source/blender/compositor/nodes/COM_BokehBlurNode.cpp index 0ea4b20c793..300193da842 100644 --- a/source/blender/compositor/nodes/COM_BokehBlurNode.cpp +++ b/source/blender/compositor/nodes/COM_BokehBlurNode.cpp @@ -37,32 +37,24 @@ BokehBlurNode::BokehBlurNode(bNode *editorNode) : Node(editorNode) void BokehBlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context) { -// Object *camob = context->getScene()->camera; + BokehBlurOperation *operation = new BokehBlurOperation(); + InputSocket *inputSizeSocket = this->getInputSocket(2); + bool connectedSizeSocket = inputSizeSocket->isConnected(); -// if (this->getInputSocket(2)->isConnected()) { -// VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation(); -// ConvertDepthToRadiusOperation *converter = new ConvertDepthToRadiusOperation(); -// converter->setfStop(this->getbNode()->custom3); -// converter->setCameraObject(camob); -// operation->setMaxBlur((int)this->getbNode()->custom4); -// operation->setQuality(context->getQuality()); -// this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); -// this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph); -// this->getInputSocket(2)->relinkConnections(converter->getInputSocket(0), 2, graph); -// addLink(graph, converter->getOutputSocket(), operation->getInputSocket(2)); -// graph->addOperation(operation); -// graph->addOperation(converter); -// this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket()); -// } -// else { - BokehBlurOperation *operation = new BokehBlurOperation(); - this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); - this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph); - this->getInputSocket(3)->relinkConnections(operation->getInputSocket(2), 3, graph); - operation->setSize(((bNodeSocketValueFloat *)this->getInputSocket(2)->getbNodeSocket()->default_value)->value); - operation->setQuality(context->getQuality()); - operation->setbNode(this->getbNode()); - graph->addOperation(operation); - this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket()); -// } + const bNodeSocket *sock = this->getInputSocket(2)->getbNodeSocket(); + const float size = ((const bNodeSocketValueFloat *)sock->default_value)->value; + + this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); + this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, graph); + this->getInputSocket(2)->relinkConnections(operation->getInputSocket(3), 2, graph); + this->getInputSocket(3)->relinkConnections(operation->getInputSocket(2), 3, graph); + //operation->setSize(((bNodeSocketValueFloat *)this->getInputSocket(2)->getbNodeSocket()->default_value)->value); + operation->setQuality(context->getQuality()); + operation->setbNode(this->getbNode()); + graph->addOperation(operation); + this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket()); + + if (!connectedSizeSocket) { + operation->setSize(size); + } } |