[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51398] trunk/blender/source/blender/ compositor/nodes/COM_ViewLevelsNode.cpp: Fix #32905: Crash with Levels node when no input is connected.

Sergey Sharybin sergey.vfx at gmail.com
Thu Oct 18 12:27:11 CEST 2012


Revision: 51398
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51398
Author:   nazgul
Date:     2012-10-18 10:27:09 +0000 (Thu, 18 Oct 2012)
Log Message:
-----------
Fix #32905: Crash with Levels node when no input is connected.

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

Modified: trunk/blender/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp
===================================================================
--- trunk/blender/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp	2012-10-18 09:48:51 UTC (rev 51397)
+++ trunk/blender/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp	2012-10-18 10:27:09 UTC (rev 51398)
@@ -24,6 +24,7 @@
 #include "COM_ExecutionSystem.h"
 #include "COM_CalculateMeanOperation.h"
 #include "COM_CalculateStandardDeviationOperation.h"
+#include "COM_SetValueOperation.h"
 
 ViewLevelsNode::ViewLevelsNode(bNode *editorNode) : Node(editorNode)
 {
@@ -64,5 +65,18 @@
 			graph->addOperation(operation);
 		}
 	}
+	else {
+		SetValueOperation *meanOutput = new SetValueOperation();
+		SetValueOperation *stdDevOutput = new SetValueOperation();
+
+		meanOutput->setValue(0.0f);
+		stdDevOutput->setValue(0.0f);
+
+		this->getOutputSocket(0)->relinkConnections(meanOutput->getOutputSocket());
+		this->getOutputSocket(1)->relinkConnections(stdDevOutput->getOutputSocket());
+
+		graph->addOperation(meanOutput);
+		graph->addOperation(stdDevOutput);
+	}
 }
 	




More information about the Bf-blender-cvs mailing list