Camera tracking integration
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 14 Jul 2011 13:36:15 +0000 (13:36 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 14 Jul 2011 13:36:15 +0000 (13:36 +0000)
===========================

Enable markers on transform

source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/makesdna/DNA_tracking_types.h

index 16e3370c8f06c0aa8ad67b177f2d423fb7f485b2..73ab60e202665714265d7f3e8c955a009c3025fc 100644 (file)
@@ -5249,24 +5249,19 @@ static void trackToTransData(SpaceClip *sc, TransData *td, TransData2D *td2d, Mo
 {
        MovieTrackingMarker *marker= BKE_tracking_ensure_marker(track, sc->user.framenr);
 
-       if((marker->flag&MARKER_DISABLED)==0) {
-               if(track->flag&SELECT)
-                       markerToTransDataInit(td++, td2d++, marker->pos, NULL);
+       track->transflag= marker->flag;
 
-               if(track->pat_flag&SELECT) {
-                       markerToTransDataInit(td++, td2d++, track->pat_min, marker->pos);
-                       markerToTransDataInit(td++, td2d++, track->pat_max, marker->pos);
-               }
-       }
+       marker->flag&= ~MARKER_DISABLED;
 
-       if(track->search_flag&SELECT) {
-               if(marker->flag&MARKER_DISABLED) {
-                       markerToTransDataInit(td++, td2d++, marker->pos, NULL);
+       if(track->flag&SELECT)
+               markerToTransDataInit(td++, td2d++, marker->pos, NULL);
 
-                       markerToTransDataInit(td++, td2d++, track->pat_min, marker->pos);
-                       markerToTransDataInit(td++, td2d++, track->pat_max, marker->pos);
-               }
+       if(track->pat_flag&SELECT) {
+               markerToTransDataInit(td++, td2d++, track->pat_min, marker->pos);
+               markerToTransDataInit(td++, td2d++, track->pat_max, marker->pos);
+       }
 
+       if(track->search_flag&SELECT) {
                markerToTransDataInit(td++, td2d++, track->search_min, marker->pos);
                markerToTransDataInit(td++, td2d++, track->search_max, marker->pos);
        }
index 8410bc45b65f80d195a9859b1444b94e479fff1a..7d7278f0f5246a8f6610e95a5d0a4f4c032b9fd1 100644 (file)
@@ -848,6 +848,18 @@ void recalcData(TransInfo *t)
                SpaceClip *sc= t->sa->spacedata.first;
                MovieClip *clip= ED_space_clip(sc);
                MovieTrackingTrack *track;
+
+               if(t->state == TRANS_CANCEL) {
+                       track= clip->tracking.tracks.first;
+                       while(track) {
+                               MovieTrackingMarker *marker= BKE_tracking_ensure_marker(track, sc->user.framenr);
+
+                               marker->flag= track->transflag;
+
+                               track= track->next;
+                       }
+               }
+
                flushTransTracking(t);
 
                track= clip->tracking.tracks.first;
index b45631bc27649f60ee6e6742ea9d10c58fee7c0e..0608890bc634efd7cfd70729d91a12522f6069fa 100644 (file)
@@ -93,6 +93,9 @@ typedef struct MovieTrackingTrack {
 
        /* ** UI editing ** */
        int flag, pat_flag, search_flag;        /* flags (selection, ...) */
+       short transflag;                                        /* transform flags */
+
+       char pad3[6];
 } MovieTrackingTrack;
 
 typedef struct MovieTrackingSettings {