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:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-12-15 11:51:09 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-12-15 11:57:15 +0300
commit2339a84443c07011acded1968a73b311b277101a (patch)
treea58d6b2ee3d2f6518a89be76a539ce77975c411a /source/blender/compositor/operations
parent879889c47c12ef8eb4aea7eee3ab63a2ec3540d5 (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')
-rw-r--r--source/blender/compositor/operations/COM_TrackPositionOperation.cpp12
-rw-r--r--source/blender/compositor/operations/COM_TrackPositionOperation.h2
2 files changed, 13 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++) {
diff --git a/source/blender/compositor/operations/COM_TrackPositionOperation.h b/source/blender/compositor/operations/COM_TrackPositionOperation.h
index 10dbaf96646..a5a58ad9f09 100644
--- a/source/blender/compositor/operations/COM_TrackPositionOperation.h
+++ b/source/blender/compositor/operations/COM_TrackPositionOperation.h
@@ -47,6 +47,7 @@ protected:
int m_axis;
int m_position;
int m_relativeFrame;
+ bool m_speed_output;
int m_width, m_height;
float m_markerPos[2];
@@ -67,6 +68,7 @@ public:
void setAxis(int value) {this->m_axis = value;}
void setPosition(int value) {this->m_position = value;}
void setRelativeFrame(int value) {this->m_relativeFrame = value;}
+ void setSpeedOutput(bool speed_output) {this->m_speed_output = speed_output;};
void initExecution();