Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2012-05-31 14:38:11 +0400
committerJeroen Bakker <j.bakker@atmind.nl>2012-05-31 14:38:11 +0400
commita9c4f76a6a96bcffc8d94e2da5e636d4304da345 (patch)
tree38f0d2593d5a5f704fb890cde3b8ba030bfb015d /source/blender/compositor/nodes
parent722ce85ff6876ab85b7e934724e89fe24241f670 (diff)
* Added new dilate/erode function
Diffstat (limited to 'source/blender/compositor/nodes')
-rw-r--r--source/blender/compositor/nodes/COM_DilateErodeNode.cpp20
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);