[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49938] trunk/blender/source/blender/ compositor/nodes/COM_BokehBlurNode.cpp: compositor bokeh blur - only use the variable size operation when the size socket is connected .

Campbell Barton ideasman42 at gmail.com
Thu Aug 16 15:15:13 CEST 2012


Revision: 49938
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49938
Author:   campbellbarton
Date:     2012-08-16 13:15:13 +0000 (Thu, 16 Aug 2012)
Log Message:
-----------
compositor bokeh blur - only use the variable size operation when the size socket is connected.

Modified Paths:
--------------
    trunk/blender/source/blender/compositor/nodes/COM_BokehBlurNode.cpp

Modified: trunk/blender/source/blender/compositor/nodes/COM_BokehBlurNode.cpp
===================================================================
--- trunk/blender/source/blender/compositor/nodes/COM_BokehBlurNode.cpp	2012-08-16 12:47:03 UTC (rev 49937)
+++ trunk/blender/source/blender/compositor/nodes/COM_BokehBlurNode.cpp	2012-08-16 13:15:13 UTC (rev 49938)
@@ -38,7 +38,11 @@
 {
 	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,10 +59,7 @@
 	}
 	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;
 




More information about the Bf-blender-cvs mailing list