diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-12-15 11:51:09 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-12-15 11:57:15 +0300 |
commit | 2339a84443c07011acded1968a73b311b277101a (patch) | |
tree | a58d6b2ee3d2f6518a89be76a539ce77975c411a /source/blender/compositor/operations/COM_TrackPositionOperation.cpp | |
parent | 879889c47c12ef8eb4aea7eee3ab63a2ec3540d5 (diff) |
Compositor: Expose track velocity via the Track Position node
velocity is measured in pixels per frame. It is basically a coordinate
difference of track coordinate at current frame and previous one (no future
prediction happens).
It's not really most intuitive place for such a things, but historically the
node was called this way..
Track velocity could be used to face effects like motion blur bu piping it
to the vector blur node.
Reviewers: campbellbarton
Reviewed By: campbellbarton
Subscribers: hype, sebastian_k
Differential Revision: https://developer.blender.org/D1591
Diffstat (limited to 'source/blender/compositor/operations/COM_TrackPositionOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_TrackPositionOperation.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/compositor/operations/COM_TrackPositionOperation.cpp b/source/blender/compositor/operations/COM_TrackPositionOperation.cpp index ca169d03fbc..52ceb50e693 100644 --- a/source/blender/compositor/operations/COM_TrackPositionOperation.cpp +++ b/source/blender/compositor/operations/COM_TrackPositionOperation.cpp @@ -45,6 +45,7 @@ TrackPositionOperation::TrackPositionOperation() : NodeOperation() this->m_axis = 0; this->m_position = CMP_TRACKPOS_ABSOLUTE; this->m_relativeFrame = 0; + this->m_speed_output = false; } void TrackPositionOperation::initExecution() @@ -78,7 +79,16 @@ void TrackPositionOperation::initExecution() copy_v2_v2(this->m_markerPos, marker->pos); - if (this->m_position == CMP_TRACKPOS_RELATIVE_START) { + if (this->m_speed_output) { + marker = BKE_tracking_marker_get(track, clip_framenr - 1); + if ((marker->flag & MARKER_DISABLED) == 0) { + copy_v2_v2(this->m_relativePos, marker->pos); + } + else { + copy_v2_v2(this->m_relativePos, this->m_markerPos); + } + } + else if (this->m_position == CMP_TRACKPOS_RELATIVE_START) { int i; for (i = 0; i < track->markersnr; i++) { |