diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-27 15:07:12 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-27 15:07:12 +0400 |
commit | 18e874798d68e4796146e9f5958f66dc3ea61909 (patch) | |
tree | 8fac06b4ab2345a1e9baa85f92fad7d06dae7ac6 /source/blender/compositor/operations/COM_TrackPositionOperation.cpp | |
parent | d0b387a0dfcb259a36d7bff3c6bdd63ee0e5a1d9 (diff) |
Track input node: more control on over output value
Now supports output value of:
- Absolute marker position
- Marker position relative to the very first marker
- Marker position relative to given scene frame
Diffstat (limited to 'source/blender/compositor/operations/COM_TrackPositionOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_TrackPositionOperation.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/compositor/operations/COM_TrackPositionOperation.cpp b/source/blender/compositor/operations/COM_TrackPositionOperation.cpp index d61bfd4b235..2b7cc8f0660 100644 --- a/source/blender/compositor/operations/COM_TrackPositionOperation.cpp +++ b/source/blender/compositor/operations/COM_TrackPositionOperation.cpp @@ -44,7 +44,8 @@ TrackPositionOperation::TrackPositionOperation() : NodeOperation() this->m_trackingObjectName[0] = 0; this->m_trackName[0] = 0; this->m_axis = 0; - this->m_relative = false; + this->m_position = POSITION_ABSOLUTE;; + this->m_relativeFrame = 0; } void TrackPositionOperation::initExecution() @@ -72,12 +73,13 @@ void TrackPositionOperation::initExecution() if (track) { MovieTrackingMarker *marker; + int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(this->m_movieClip, this->m_framenumber); - marker = BKE_tracking_marker_get(track, this->m_framenumber); + marker = BKE_tracking_marker_get(track, clip_framenr); copy_v2_v2(this->m_markerPos, marker->pos); - if (this->m_relative) { + if (this->m_position == POSITION_RELATIVE_START) { int i; for (i = 0; i < track->markersnr; i++) { @@ -90,6 +92,13 @@ void TrackPositionOperation::initExecution() } } } + else if (this->m_position == POSITION_RELATIVE_FRAME) { + int relative_clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(this->m_movieClip, + this->m_relativeFrame); + + marker = BKE_tracking_marker_get(track, relative_clip_framenr); + copy_v2_v2(this->m_relativePos, marker->pos); + } } } } |