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@blender.org>2020-11-30 17:03:31 +0300
committerSergey Sharybin <sergey@blender.org>2020-11-30 17:03:31 +0300
commitecfacb77061a330dddb5794242607709e06843bc (patch)
tree9077403238462073d123497de913ed54f1164f34
parentc949062c6eeedf7c6b0fb3029217effd301575c5 (diff)
Tracking: Cleanup, use explicit frame match option
No functional changes, just allows to potentially extend the options in the future, and also makes code more explicit.
-rw-r--r--source/blender/blenkernel/intern/tracking_auto.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/tracking_auto.c b/source/blender/blenkernel/intern/tracking_auto.c
index faa1f207788..2027d4b2dd1 100644
--- a/source/blender/blenkernel/intern/tracking_auto.c
+++ b/source/blender/blenkernel/intern/tracking_auto.c
@@ -46,7 +46,9 @@ typedef struct AutoTrackOptions {
int track_index; /* Index of the track in AutoTrack tracks structure. */
MovieTrackingTrack *track; /* Pointer to an original track/ */
libmv_TrackRegionOptions track_region_options; /* Options for the region tracker. */
- bool use_keyframe_match; /* Keyframe pattern matching. */
+
+ /* Define which frame is used for reference marker. */
+ eTrackFrameMatch frame_match;
/* TODO(sergey): A bit awkward to keep it in here, only used to
* place a disabled marker once the tracking fails,
@@ -361,7 +363,7 @@ static void create_per_track_tracking_options(const MovieClip *clip,
track_options->clip_index = 0;
track_options->track_index = track_index;
track_options->track = track;
- track_options->use_keyframe_match = (track->pattern_match == TRACK_MATCH_KEYFRAME);
+ track_options->frame_match = track->pattern_match;
tracking_configure_tracker(track, NULL, &track_options->track_region_options);
@@ -445,7 +447,7 @@ static void autotrack_context_step_cb(void *__restrict userdata,
libmv_tracked_marker = libmv_current_marker;
libmv_tracked_marker.frame = frame + frame_delta;
/* Update reference frame. */
- if (track_options->use_keyframe_match) {
+ if (track_options->frame_match == TRACK_MATCH_KEYFRAME) {
libmv_tracked_marker.reference_frame = libmv_current_marker.reference_frame;
libmv_autoTrackGetMarker(context->autotrack,
track_options->clip_index,
@@ -454,6 +456,7 @@ static void autotrack_context_step_cb(void *__restrict userdata,
&libmv_reference_marker);
}
else {
+ BLI_assert(track_options->frame_match == TRACK_MATCH_PREVIOS_FRAME);
libmv_tracked_marker.reference_frame = frame;
libmv_reference_marker = libmv_current_marker;
}