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_PlaneTrackDeformNode.cpp')
-rw-r--r--source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cpp62
1 files changed, 26 insertions, 36 deletions
diff --git a/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cpp b/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cpp
index 944e04e4f4f..9b69bc5a46e 100644
--- a/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cpp
+++ b/source/blender/compositor/nodes/COM_PlaneTrackDeformNode.cpp
@@ -37,44 +37,34 @@ PlaneTrackDeformNode::PlaneTrackDeformNode(bNode *editorNode) : Node(editorNode)
/* pass */
}
-void PlaneTrackDeformNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
+void PlaneTrackDeformNode::convertToOperations(NodeConverter &converter, const CompositorContext &context) const
{
- InputSocket *input_image = this->getInputSocket(0);
-
- OutputSocket *output_warped_image = this->getOutputSocket(0);
- OutputSocket *output_plane = this->getOutputSocket(1);
-
bNode *editorNode = this->getbNode();
MovieClip *clip = (MovieClip *) editorNode->id;
-
NodePlaneTrackDeformData *data = (NodePlaneTrackDeformData *) editorNode->storage;
-
- int frame_number = context->getFramenumber();
-
- if (output_warped_image->isConnected()) {
- PlaneTrackWarpImageOperation *warp_image_operation = new PlaneTrackWarpImageOperation();
-
- warp_image_operation->setMovieClip(clip);
- warp_image_operation->setTrackingObject(data->tracking_object);
- warp_image_operation->setPlaneTrackName(data->plane_track_name);
- warp_image_operation->setFramenumber(frame_number);
-
- input_image->relinkConnections(warp_image_operation->getInputSocket(0), 0, graph);
- output_warped_image->relinkConnections(warp_image_operation->getOutputSocket());
-
- graph->addOperation(warp_image_operation);
- }
-
- if (output_plane->isConnected()) {
- PlaneTrackMaskOperation *plane_mask_operation = new PlaneTrackMaskOperation();
-
- plane_mask_operation->setMovieClip(clip);
- plane_mask_operation->setTrackingObject(data->tracking_object);
- plane_mask_operation->setPlaneTrackName(data->plane_track_name);
- plane_mask_operation->setFramenumber(frame_number);
-
- output_plane->relinkConnections(plane_mask_operation->getOutputSocket());
-
- graph->addOperation(plane_mask_operation);
- }
+
+ int frame_number = context.getFramenumber();
+
+ NodeInput *input_image = this->getInputSocket(0);
+ NodeOutput *output_warped_image = this->getOutputSocket(0);
+ NodeOutput *output_plane = this->getOutputSocket(1);
+
+ PlaneTrackWarpImageOperation *warp_image_operation = new PlaneTrackWarpImageOperation();
+ warp_image_operation->setMovieClip(clip);
+ warp_image_operation->setTrackingObject(data->tracking_object);
+ warp_image_operation->setPlaneTrackName(data->plane_track_name);
+ warp_image_operation->setFramenumber(frame_number);
+ converter.addOperation(warp_image_operation);
+
+ converter.mapInputSocket(input_image, warp_image_operation->getInputSocket(0));
+ converter.mapOutputSocket(output_warped_image, warp_image_operation->getOutputSocket());
+
+ PlaneTrackMaskOperation *plane_mask_operation = new PlaneTrackMaskOperation();
+ plane_mask_operation->setMovieClip(clip);
+ plane_mask_operation->setTrackingObject(data->tracking_object);
+ plane_mask_operation->setPlaneTrackName(data->plane_track_name);
+ plane_mask_operation->setFramenumber(frame_number);
+ converter.addOperation(plane_mask_operation);
+
+ converter.mapOutputSocket(output_plane, plane_mask_operation->getOutputSocket());
}