diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-02-15 14:43:14 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-02-15 14:43:14 +0300 |
commit | 473eff2df8eecaf4cddafbfce6c8d1386d4ec68a (patch) | |
tree | d5c9bf63fe18ac3af804144b362b7ba7383cd068 /source/blender/compositor/operations/COM_TrackPositionOperation.cpp | |
parent | 6371fccdbe34ac214f54a8843dc6d2c9f1e05d92 (diff) |
Compositor: Re-consider the way how track speed works
Based on an user feedback, previous implementation with providing
decoupled X and Y speeds didn't work in production at all: there
is no way to combine this speeds to an usable vector.
So now we're providing speed vector output instead, which provides
speed in an exactly the way Vector Blur node expects it to be:
first two components is a speed from the past, second two components
defines speed to the future.
Old behavior can be achieved by RGBA separating the speed output
and using first tow components.
Now this speed gives quite the same results as a speed pass, with
the only difference that track position speed uses "shutter" of
1 while pass uses shutter of 0.5 (and there's no way to affect on
that?).
Diffstat (limited to 'source/blender/compositor/operations/COM_TrackPositionOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_TrackPositionOperation.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/compositor/operations/COM_TrackPositionOperation.cpp b/source/blender/compositor/operations/COM_TrackPositionOperation.cpp index 52ceb50e693..f9db897deba 100644 --- a/source/blender/compositor/operations/COM_TrackPositionOperation.cpp +++ b/source/blender/compositor/operations/COM_TrackPositionOperation.cpp @@ -80,13 +80,22 @@ void TrackPositionOperation::initExecution() copy_v2_v2(this->m_markerPos, marker->pos); if (this->m_speed_output) { - marker = BKE_tracking_marker_get(track, clip_framenr - 1); - if ((marker->flag & MARKER_DISABLED) == 0) { + int relative_clip_framenr = + BKE_movieclip_remap_scene_to_clip_frame( + this->m_movieClip, + this->m_relativeFrame); + + marker = BKE_tracking_marker_get_exact(track, + relative_clip_framenr); + if (marker != NULL && (marker->flag & MARKER_DISABLED) == 0) { copy_v2_v2(this->m_relativePos, marker->pos); } else { copy_v2_v2(this->m_relativePos, this->m_markerPos); } + if (this->m_relativeFrame < this->m_framenumber) { + swap_v2_v2(this->m_relativePos, this->m_markerPos); + } } else if (this->m_position == CMP_TRACKPOS_RELATIVE_START) { int i; |