diff options
author | Sergey Sharybin <sergey@blender.org> | 2020-11-30 16:36:03 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2020-11-30 16:36:03 +0300 |
commit | d61a6a8cc3b1eab306f3795f2b91276aaaeed231 (patch) | |
tree | 943d96029e0b421cf2dc296388ced8f625a70768 /source/blender/blenkernel | |
parent | 88289d8f844d802c5f06da8b69f42d25e7e33b44 (diff) |
Tracking: Fix missing frame remap for plane tracks
Tracking track which is used for plane track and movie clip having
a scene frame offset would have trigger re-calculation from a wrong
frame.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/tracking_auto.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/tracking_auto.c b/source/blender/blenkernel/intern/tracking_auto.c index deeaa85fa80..1dc047be7bf 100644 --- a/source/blender/blenkernel/intern/tracking_auto.c +++ b/source/blender/blenkernel/intern/tracking_auto.c @@ -59,7 +59,7 @@ typedef struct AutoTrackOptions { typedef struct AutoTrackContext { /* Frame at which tracking process started. - * TODO(sergey): Disambiguate whether it is a scene or clip frame. */ + * NOTE: Measured in scene time frames, */ int start_frame; /* True when tracking backwards (from higher frame number to lower frame number.) */ @@ -554,6 +554,8 @@ void BKE_autotrack_context_finish(AutoTrackContext *context) for (int clip_index = 0; clip_index < context->num_clips; clip_index++) { MovieClip *clip = context->clips[clip_index]; ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(&clip->tracking); + const int start_clip_frame = BKE_movieclip_remap_scene_to_clip_frame(clip, + context->start_frame); LISTBASE_FOREACH (MovieTrackingPlaneTrack *, plane_track, plane_tracks_base) { if ((plane_track->flag & PLANE_TRACK_AUTOKEY)) { @@ -563,7 +565,7 @@ void BKE_autotrack_context_finish(AutoTrackContext *context) const AutoTrackOptions *track_options = &context->track_options[i]; MovieTrackingTrack *track = track_options->track; if (BKE_tracking_plane_track_has_point_track(plane_track, track)) { - BKE_tracking_track_plane_from_existing_motion(plane_track, context->start_frame); + BKE_tracking_track_plane_from_existing_motion(plane_track, start_clip_frame); break; } } |