diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-06-12 18:28:36 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-06-12 18:28:36 +0400 |
commit | 9aa088bab68adb1488ae42c14813babbab594117 (patch) | |
tree | 328c2d17a5841e3102c47dadabfc2b291ac668f8 /source/blender/compositor/nodes | |
parent | ba3a1067fa831d8fa7812049a1c3ee08a6b27bd9 (diff) |
Track Position node now could output absolute position of track at a given frame
Diffstat (limited to 'source/blender/compositor/nodes')
-rw-r--r-- | source/blender/compositor/nodes/COM_TrackPositionNode.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/compositor/nodes/COM_TrackPositionNode.cpp b/source/blender/compositor/nodes/COM_TrackPositionNode.cpp index f4efcfe27f0..c5474e0ce70 100644 --- a/source/blender/compositor/nodes/COM_TrackPositionNode.cpp +++ b/source/blender/compositor/nodes/COM_TrackPositionNode.cpp @@ -27,6 +27,8 @@ extern "C" { #include "DNA_movieclip_types.h" + + #include "BKE_node.h" } TrackPositionNode::TrackPositionNode(bNode *editorNode) : Node(editorNode) @@ -44,13 +46,21 @@ void TrackPositionNode::convertToOperations(ExecutionSystem *graph, CompositorCo NodeTrackPosData *trackpos_data = (NodeTrackPosData *) editorNode->storage; + int frame_number; + if (editorNode->custom1 == CMP_TRACKPOS_ABSOLUTE_FRAME) { + frame_number = editorNode->custom2; + } + else { + frame_number = context->getFramenumber(); + } + TrackPositionOperation *operationX = new TrackPositionOperation(); TrackPositionOperation *operationY = new TrackPositionOperation(); operationX->setMovieClip(clip); operationX->setTrackingObject(trackpos_data->tracking_object); operationX->setTrackName(trackpos_data->track_name); - operationX->setFramenumber(context->getFramenumber()); + operationX->setFramenumber(frame_number); operationX->setAxis(0); operationX->setPosition(editorNode->custom1); operationX->setRelativeFrame(editorNode->custom2); @@ -58,7 +68,7 @@ void TrackPositionNode::convertToOperations(ExecutionSystem *graph, CompositorCo operationY->setMovieClip(clip); operationY->setTrackingObject(trackpos_data->tracking_object); operationY->setTrackName(trackpos_data->track_name); - operationY->setFramenumber(context->getFramenumber()); + operationY->setFramenumber(frame_number); operationY->setAxis(1); operationY->setPosition(editorNode->custom1); operationY->setRelativeFrame(editorNode->custom2); |