2D stabilizer: Use exact getter instead of regular one followed with frame check
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 17 Aug 2016 08:49:42 +0000 (10:49 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 17 Aug 2016 08:49:42 +0000 (10:49 +0200)
source/blender/blenkernel/intern/tracking_stabilize.c

index c352625789ff4a7ab1917103989db4ddb0f353a0..4d72d851ae95f386e5862edf514314d11b062bc4 100644 (file)
@@ -438,16 +438,16 @@ static MovieTrackingMarker *get_tracking_data_point(
         StabContext *ctx,
         MovieTrackingTrack *track,
         int framenr,
-        float *weight)
+        float *r_weight)
 {
-       MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr);
-       if (marker && marker->framenr == framenr && !(marker->flag & MARKER_DISABLED)) {
-               *weight = get_animated_weight(ctx, track, framenr);
+       MovieTrackingMarker *marker = BKE_tracking_marker_get_exact(track, framenr);
+       if (marker != NULL && !(marker->flag & MARKER_DISABLED)) {
+               *r_weight = get_animated_weight(ctx, track, framenr);
                return marker;
        }
        else {
-               /* no marker at this frame (=gap) or marker disabled */
-               *weight = 0.0f;
+               /* No marker at this frame (=gap) or marker disabled. */
+               *r_weight = 0.0f;
                return NULL;
        }
 }