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:
authorMonique Dewanchand <m.dewanchand@atmind.nl>2013-02-06 12:40:12 +0400
committerMonique Dewanchand <m.dewanchand@atmind.nl>2013-02-06 12:40:12 +0400
commit23bf087338204b45e5b72c1269bd013a88cf3f9d (patch)
treeb90552717bd7c3af01697d33de29b3872d6d537a /source/blender/compositor/nodes/COM_TranslateNode.cpp
parenta78cf854b4c811d5df24d10cf3b9a0d9d6679ca0 (diff)
Code clean up translate node
added constants. moved the code to a separate class. so it can be reused for other nodes
Diffstat (limited to 'source/blender/compositor/nodes/COM_TranslateNode.cpp')
-rw-r--r--source/blender/compositor/nodes/COM_TranslateNode.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/compositor/nodes/COM_TranslateNode.cpp b/source/blender/compositor/nodes/COM_TranslateNode.cpp
index 887190b44b9..433ee2e5972 100644
--- a/source/blender/compositor/nodes/COM_TranslateNode.cpp
+++ b/source/blender/compositor/nodes/COM_TranslateNode.cpp
@@ -23,6 +23,7 @@
#include "COM_TranslateNode.h"
#include "COM_TranslateOperation.h"
+#include "COM_WrapOperation.h"
#include "COM_ExecutionSystem.h"
TranslateNode::TranslateNode(bNode *editorNode) : Node(editorNode)
@@ -40,7 +41,16 @@ void TranslateNode::convertToOperations(ExecutionSystem *graph, CompositorContex
bNode *bnode = this->getbNode();
NodeTranslateData *data = (NodeTranslateData *)bnode->storage;
- operation->setWrapping(data->wrap_axis);
+
+ if (data->wrap_axis) {
+ WrapOperation *wrapOperation = new WrapOperation();
+ wrapOperation->setWrapping(data->wrap_axis);
+ inputSocket->relinkConnections(wrapOperation->getInputSocket(0), 0, graph);
+ addLink(graph, wrapOperation->getOutputSocket(), operation->getInputSocket(0));
+ graph->addOperation(wrapOperation);
+ } else {
+ inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
+ }
if (data->relative) {
const RenderData *rd = context->getRenderData();
@@ -50,7 +60,6 @@ void TranslateNode::convertToOperations(ExecutionSystem *graph, CompositorContex
operation->setFactorXY(fx, fy);
}
- inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
inputXSocket->relinkConnections(operation->getInputSocket(1), 1, graph);
inputYSocket->relinkConnections(operation->getInputSocket(2), 2, graph);
outputSocket->relinkConnections(operation->getOutputSocket(0));