forked from bartvdbraak/blender
Fix #32905: Crash with Levels node when no input is connected.
This commit is contained in:
parent
3086300149
commit
a4724a2dd8
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user