compositor bokeh blur - only use the variable size operation when the size socket...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 16 Aug 2012 13:15:13 +0000 (13:15 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 16 Aug 2012 13:15:13 +0000 (13:15 +0000)
source/blender/compositor/nodes/COM_BokehBlurNode.cpp

index 9abf97aa16f4945de36a2737825ad7f7bc5322b1..70f20e3235bbf982e7edc1f23441b01fc264d215 100644 (file)
@@ -38,7 +38,11 @@ void BokehBlurNode::convertToOperations(ExecutionSystem *graph, CompositorContex
 {
        bNode *b_node = this->getbNode();
 
-       if (b_node->custom1 & CMP_NODEFLAG_BLUR_VARIABLE_SIZE) {
+       InputSocket *inputSizeSocket = this->getInputSocket(2);
+
+       bool connectedSizeSocket = inputSizeSocket->isConnected();
+
+       if ((b_node->custom1 & CMP_NODEFLAG_BLUR_VARIABLE_SIZE) && connectedSizeSocket) {
                VariableSizeBokehBlurOperation *operation = new VariableSizeBokehBlurOperation();
 
                this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
@@ -55,9 +59,6 @@ void BokehBlurNode::convertToOperations(ExecutionSystem *graph, CompositorContex
        }
        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;