diff options
Diffstat (limited to 'source/blender/compositor/nodes/COM_DilateErodeNode.cpp')
-rw-r--r-- | source/blender/compositor/nodes/COM_DilateErodeNode.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp index cc96f672ebd..b722e40a875 100644 --- a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp +++ b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp @@ -35,7 +35,7 @@ void DilateErodeNode::convertToOperations(ExecutionSystem *graph, CompositorCont { bNode *editorNode = this->getbNode(); - if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE) { + if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE_THRESH) { DilateErodeDistanceOperation *operation = new DilateErodeDistanceOperation(); operation->setDistance(editorNode->custom2); operation->setInset(editorNode->custom3); @@ -52,8 +52,22 @@ void DilateErodeNode::convertToOperations(ExecutionSystem *graph, CompositorCont this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0)); } graph->addOperation(operation); - } - else { + } else if (editorNode->custom1 == CMP_NODE_DILATEERODE_DISTANCE) { + if (editorNode->custom2 > 0) { + DilateDistanceOperation * operation = new DilateDistanceOperation(); + operation->setDistance(editorNode->custom2); + this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); + this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0)); + graph->addOperation(operation); + } + else { + ErodeDistanceOperation * operation = new ErodeDistanceOperation(); + operation->setDistance(-editorNode->custom2); + this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph); + this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0)); + graph->addOperation(operation); + } + } else { if (editorNode->custom2 > 0) { DilateStepOperation * operation = new DilateStepOperation(); operation->setIterations(editorNode->custom2); |