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_ScaleNode.cpp')
-rw-r--r--source/blender/compositor/nodes/COM_ScaleNode.cpp71
1 files changed, 35 insertions, 36 deletions
diff --git a/source/blender/compositor/nodes/COM_ScaleNode.cpp b/source/blender/compositor/nodes/COM_ScaleNode.cpp
index e139eb83e04..61eea9227dc 100644
--- a/source/blender/compositor/nodes/COM_ScaleNode.cpp
+++ b/source/blender/compositor/nodes/COM_ScaleNode.cpp
@@ -33,71 +33,70 @@ ScaleNode::ScaleNode(bNode *editorNode) : Node(editorNode)
/* pass */
}
-void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
+void ScaleNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const
{
- InputSocket *inputSocket = this->getInputSocket(0);
- InputSocket *inputXSocket = this->getInputSocket(1);
- InputSocket *inputYSocket = this->getInputSocket(2);
- OutputSocket *outputSocket = this->getOutputSocket(0);
- BaseScaleOperation *scaleoperation = NULL;
bNode *bnode = this->getbNode();
+
+ NodeInput *inputSocket = this->getInputSocket(0);
+ NodeInput *inputXSocket = this->getInputSocket(1);
+ NodeInput *inputYSocket = this->getInputSocket(2);
+ NodeOutput *outputSocket = this->getOutputSocket(0);
switch (bnode->custom1) {
case CMP_SCALE_RELATIVE:
{
ScaleOperation *operation = new ScaleOperation();
-
- inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
- inputXSocket->relinkConnections(operation->getInputSocket(1), 1, graph);
- inputYSocket->relinkConnections(operation->getInputSocket(2), 2, graph);
-
- scaleoperation = operation;
+ converter.addOperation(operation);
+
+ converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
+ converter.mapInputSocket(inputXSocket, operation->getInputSocket(1));
+ converter.mapInputSocket(inputYSocket, operation->getInputSocket(2));
+ converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
break;
}
case CMP_SCALE_SCENEPERCENT:
{
SetValueOperation *scaleFactorOperation = new SetValueOperation();
- scaleFactorOperation->setValue(context->getRenderData()->size / 100.0f);
+ scaleFactorOperation->setValue(context.getRenderData()->size / 100.0f);
+ converter.addOperation(scaleFactorOperation);
+
ScaleOperation *operation = new ScaleOperation();
- inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
- addLink(graph, scaleFactorOperation->getOutputSocket(), operation->getInputSocket(1));
- addLink(graph, scaleFactorOperation->getOutputSocket(), operation->getInputSocket(2));
- graph->addOperation(scaleFactorOperation);
-
- scaleoperation = operation;
+ converter.addOperation(operation);
+
+ converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
+ converter.addLink(scaleFactorOperation->getOutputSocket(), operation->getInputSocket(1));
+ converter.addLink(scaleFactorOperation->getOutputSocket(), operation->getInputSocket(2));
+ converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
break;
}
case CMP_SCALE_RENDERPERCENT:
{
- const RenderData *rd = context->getRenderData();
+ const RenderData *rd = context.getRenderData();
ScaleFixedSizeOperation *operation = new ScaleFixedSizeOperation();
-
/* framing options */
operation->setIsAspect((bnode->custom2 & CMP_SCALE_RENDERSIZE_FRAME_ASPECT) != 0);
operation->setIsCrop((bnode->custom2 & CMP_SCALE_RENDERSIZE_FRAME_CROP) != 0);
operation->setOffset(bnode->custom3, bnode->custom4);
-
operation->setNewWidth(rd->xsch * rd->size / 100.0f);
operation->setNewHeight(rd->ysch * rd->size / 100.0f);
- inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
- operation->getInputSocket(0)->getConnection()->setIgnoreResizeCheck(true);
-
- scaleoperation = operation;
+ operation->getInputSocket(0)->setResizeMode(COM_SC_NO_RESIZE);
+ converter.addOperation(operation);
+
+ converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
+ converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
break;
}
case CMP_SCALE_ABSOLUTE:
{
- ScaleAbsoluteOperation *operation = new ScaleAbsoluteOperation(); // TODO: what is the use of this one.... perhaps some issues when the ui was updated....
-
- inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
- inputXSocket->relinkConnections(operation->getInputSocket(1), 1, graph);
- inputYSocket->relinkConnections(operation->getInputSocket(2), 2, graph);
-
- scaleoperation = operation;
+ /* TODO: what is the use of this one.... perhaps some issues when the ui was updated... */
+ ScaleAbsoluteOperation *operation = new ScaleAbsoluteOperation();
+ converter.addOperation(operation);
+
+ converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
+ converter.mapInputSocket(inputXSocket, operation->getInputSocket(1));
+ converter.mapInputSocket(inputYSocket, operation->getInputSocket(2));
+ converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
break;
}
}
-
- outputSocket->relinkConnections(scaleoperation->getOutputSocket(0));
- graph->addOperation(scaleoperation);
}