diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-09-17 12:54:10 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-09-17 12:54:10 +0400 |
commit | b9be47e91c64876d65d6bd061bc3ff3ee347d03e (patch) | |
tree | 87f06414c5ddd48d4530043ef29c524f0385d46f /source/blender/editors/space_clip | |
parent | bf5bbda187c891b75e6ee0fa8fd33dcf138f2ab9 (diff) |
Re-track the plane after clearing the keyframe
From the math point of view there're two cases:
- Clearing the keyframe between two other ones.
In this case tracker will first track plane from
left keyframe to right one without doing any kind
of blending. This will make plane stick to the
actual plane motion, but lead to possible jump
at the right keyframe.
Second step is to track from the right keyframe
to the left one with blending. This gives nice
transition at the point of second keyframe and
this mimics situation when you've been setting
keyframes from left to right.
- Clearing left-most/right-most keyframe.
In this case it's enough to only re-track the
plane without blending from the neighbor keyframe
without blending.
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r-- | source/blender/editors/space_clip/tracking_ops.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 59101b24ad8..a4cd1e1ccad 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -4135,14 +4135,22 @@ static void keyframe_set_flag(bContext *C, bool set) MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get_exact(plane_track, framenr); if (plane_marker) { if (set) { - plane_marker->flag &= ~PLANE_MARKER_TRACKED; + if (plane_marker->flag & PLANE_MARKER_TRACKED) { + plane_marker->flag &= ~PLANE_MARKER_TRACKED; + BKE_tracking_track_plane_from_existing_motion(plane_track, plane_marker->framenr); + } } else { - plane_marker->flag |= PLANE_MARKER_TRACKED; + if ((plane_marker->flag & PLANE_MARKER_TRACKED) == 0) { + plane_marker->flag |= PLANE_MARKER_TRACKED; + BKE_tracking_retrack_plane_from_existing_motion_at_segment(plane_track, plane_marker->framenr); + } } } } } + + WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, clip); } static int keyframe_insert_exec(bContext *C, wmOperator *UNUSED(op)) |