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:
Diffstat (limited to 'source/blender/compositor/nodes/COM_SwitchNode.cpp')
-rw-r--r--source/blender/compositor/nodes/COM_SwitchNode.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/source/blender/compositor/nodes/COM_SwitchNode.cpp b/source/blender/compositor/nodes/COM_SwitchNode.cpp
index 2a4616fcd3e..692b8d743f6 100644
--- a/source/blender/compositor/nodes/COM_SwitchNode.cpp
+++ b/source/blender/compositor/nodes/COM_SwitchNode.cpp
@@ -21,27 +21,21 @@
*/
#include "COM_SwitchNode.h"
-#include "COM_ExecutionSystem.h"
-#include "COM_SocketProxyOperation.h"
SwitchNode::SwitchNode(bNode *editorNode) : Node(editorNode)
{
/* pass */
}
-
-void SwitchNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
+void SwitchNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const
{
- SocketProxyOperation *operation = new SocketProxyOperation(COM_DT_COLOR);
- int switchFrame = this->getbNode()->custom1;
-
- if (!switchFrame) {
- this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
- }
- else {
- this->getInputSocket(1)->relinkConnections(operation->getInputSocket(0), 1, graph);
- }
- this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket());
-
- graph->addOperation(operation);
+ bool condition = this->getbNode()->custom1;
+
+ NodeOperationOutput *result;
+ if (!condition)
+ result = converter.addInputProxy(getInputSocket(0));
+ else
+ result = converter.addInputProxy(getInputSocket(1));
+
+ converter.mapOutputSocket(getOutputSocket(0), result);
}