diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-10-18 14:27:09 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-10-18 14:27:09 +0400 |
commit | a4724a2dd8f884fc3beaee4f49e33093069c1a35 (patch) | |
tree | afcc6807acd5b803934f8bbe55b87fdae994fcc2 /source/blender/compositor/nodes/COM_ViewLevelsNode.cpp | |
parent | 3086300149464dae8f419cd2066afb5ffd34af56 (diff) |
Fix #32905: Crash with Levels node when no input is connected.
Diffstat (limited to 'source/blender/compositor/nodes/COM_ViewLevelsNode.cpp')
-rw-r--r-- | source/blender/compositor/nodes/COM_ViewLevelsNode.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp b/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp index 6bb873e0dec..a515bfc7f47 100644 --- a/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp +++ b/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp @@ -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 @@ void ViewLevelsNode::convertToOperations(ExecutionSystem *graph, CompositorConte 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); + } } |