Camera tracking integration
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 28 Jun 2011 16:44:10 +0000 (16:44 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 28 Jun 2011 16:44:10 +0000 (16:44 +0000)
===========================

Request from Sebastian K├Ânig:

Change behaviour of "Clear Track Path" operator to clear
data for frames after current rather than clearing the whole track data.

source/blender/blenkernel/intern/tracking.c

index 97780df589a96876b8dc89753031c8a984f9c9fa..90f4ef0c9936311542693449c23dee0b82840e15 100644 (file)
@@ -255,21 +255,16 @@ MovieTrackingTrack *BKE_tracking_copy_track(MovieTrackingTrack *track)
 
 void BKE_tracking_clear_path(MovieTrackingTrack *track, int ref_frame)
 {
-       MovieTrackingMarker *marker, new_marker;
+       int a= 1;
 
-       if(track->markersnr==0)
-               return;
-
-       marker= BKE_tracking_get_marker(track, ref_frame);
-       if(marker) new_marker= *marker;
-       else new_marker= track->markers[0];
-
-       MEM_freeN(track->markers);
-       track->markers= NULL;
-       track->markersnr= 0;
-       track->flag&= ~TRACK_PROCESSED;
+       while(a<track->markersnr) {
+               if(track->markers[a].framenr>ref_frame) {
+                       track->markersnr= a;
+                       track->markers= MEM_reallocN(track->markers, sizeof(MovieTrackingMarker)*track->markersnr);
+               }
 
-       BKE_tracking_insert_marker(track, &new_marker);
+               a++;
+       }
 }
 
 void BKE_tracking_free(MovieTracking *tracking)