Disable markers when doing frame-by-frame tracking and tracker library returns failure
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 7 Dec 2011 11:02:34 +0000 (11:02 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 7 Dec 2011 11:02:34 +0000 (11:02 +0000)
source/blender/blenkernel/BKE_tracking.h
source/blender/blenkernel/intern/tracking.c
source/blender/editors/space_clip/tracking_ops.c

index 6c43493d1d4df20c6add1ebee4f5d0099f365928..d7bf7cb410f6b7cefcbd53755924c9198141b3c3 100644 (file)
@@ -98,7 +98,7 @@ struct MovieTrackingReconstruction *BKE_tracking_object_reconstruction(struct Mo
 
 /* 2D tracking */
 struct MovieTrackingContext *BKE_tracking_context_new(struct MovieClip *clip, struct MovieClipUser *user,
-                       short backwards, short disable_failed);
+                       short backwards);
 void BKE_tracking_context_free(struct MovieTrackingContext *context);
 void BKE_tracking_sync(struct MovieTrackingContext *context);
 void BKE_tracking_sync_user(struct MovieClipUser *user, struct MovieTrackingContext *context);
index d1929e25c4038451670910dae942fc45c0e546b7..164320562f4383a1a505ac423a3806612451d236 100644 (file)
@@ -784,11 +784,11 @@ typedef struct MovieTrackingContext {
        MovieTrackingSettings settings;
        TracksMap *tracks_map;
 
-       short backwards, disable_failed;
+       short backwards;
        int sync_frame;
 } MovieTrackingContext;
 
-MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *user, short backwards, short disable_failed)
+MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *user, short backwards)
 {
        MovieTrackingContext *context= MEM_callocN(sizeof(MovieTrackingContext), "trackingContext");
        MovieTracking *tracking= &clip->tracking;
@@ -800,7 +800,6 @@ MovieTrackingContext *BKE_tracking_context_new(MovieClip *clip, MovieClipUser *u
 
        context->settings= *settings;
        context->backwards= backwards;
-       context->disable_failed= disable_failed;
        context->sync_frame= user->framenr;
        context->first_time= 1;
 
@@ -1356,7 +1355,7 @@ int BKE_tracking_next(MovieTrackingContext *context)
                        }
 
                        coords_correct= !isnan(x2) && !isnan(y2) && finite(x2) && finite(y2);
-                       if(coords_correct && (tracked || !context->disable_failed)) {
+                       if(coords_correct && !onbound && tracked) {
                                if(context->first_time) {
                                        #pragma omp critical
                                        {
index 59631e3a18165975f31ce2a2cf8f10d02a03cfc8..49ea3247a554bbfc774453287cd78ffde3ac4d4d 100644 (file)
@@ -1317,7 +1317,7 @@ static int track_markers_initjob(bContext *C, TrackMarkersJob *tmj, int backward
                else if(settings->speed==TRACKING_SPEED_DOUBLE) tmj->delay/= 2;
        }
 
-       tmj->context= BKE_tracking_context_new(clip, &sc->user, backwards, 1);
+       tmj->context= BKE_tracking_context_new(clip, &sc->user, backwards);
 
        clip->tracking_context= tmj->context;
 
@@ -1428,7 +1428,7 @@ static int track_markers_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
 
        /* do not disable tracks due to threshold when tracking frame-by-frame */
-       context= BKE_tracking_context_new(clip, &sc->user, backwards, sequence);
+       context= BKE_tracking_context_new(clip, &sc->user, backwards);
 
        while(framenr != efra) {
                if(!BKE_tracking_next(context))