Camera tracking: show disabled active track even if Show Disabled is switched off
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 3 May 2012 23:41:28 +0000 (23:41 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 3 May 2012 23:41:28 +0000 (23:41 +0000)
source/blender/blenkernel/BKE_tracking.h
source/blender/editors/space_clip/clip_draw.c
source/blender/editors/space_clip/tracking_ops.c

index 0782396dbaeafc5230134b96174a581eced4b540..817cb477abad0173b57ea272e8c79350d66237b4 100644 (file)
@@ -179,7 +179,7 @@ void BKE_tracking_dopesheet_update(struct MovieTracking *tracking, int sort_meth
                                                 (((sc)->flag & SC_SHOW_MARKER_PATTERN) && TRACK_AREA_SELECTED(track, TRACK_AREA_PAT)) || \
                                                 (((sc)->flag & SC_SHOW_MARKER_SEARCH) && TRACK_AREA_SELECTED(track, TRACK_AREA_SEARCH))))
 
-#define MARKER_VISIBLE(sc, marker)                     (((marker)->flag & MARKER_DISABLED)==0 || ((sc)->flag & SC_HIDE_DISABLED)==0)
+#define MARKER_VISIBLE(sc, track, marker)              (((marker)->flag & MARKER_DISABLED)==0 || ((sc)->flag & SC_HIDE_DISABLED)==0 || (sc->clip->tracking.act_track == track))
 
 #define TRACK_CLEAR_UPTO               0
 #define TRACK_CLEAR_REMAINED   1
index 0d519f36ba318994b4dfebfb874c04a4c050e9c7..6759743fabea659e0292c18780d0ba496eef9f3a 100644 (file)
@@ -974,7 +974,7 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
                        if ((track->flag & TRACK_HIDDEN)==0) {
                                marker = BKE_tracking_get_marker(track, framenr);
 
-                               if (MARKER_VISIBLE(sc, marker))
+                               if (MARKER_VISIBLE(sc, track, marker))
                                        count++;
                        }
 
@@ -991,7 +991,7 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
                                if ((track->flag & TRACK_HIDDEN)==0) {
                                        marker = BKE_tracking_get_marker(track, framenr);
 
-                                       if (MARKER_VISIBLE(sc, marker)) {
+                                       if (MARKER_VISIBLE(sc, track, marker)) {
                                                ED_clip_point_undistorted_pos(sc, marker->pos, fp);
 
                                                if (track == act_track)
@@ -1023,7 +1023,7 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
                if ((track->flag & TRACK_HIDDEN)==0) {
                        marker = BKE_tracking_get_marker(track, framenr);
 
-                       if (MARKER_VISIBLE(sc, marker)) {
+                       if (MARKER_VISIBLE(sc, track, marker)) {
                                copy_v2_v2(cur_pos, fp ? fp : marker->pos);
 
                                draw_marker_outline(sc, track, marker, cur_pos, width, height);
@@ -1048,7 +1048,7 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
                        int act = track == act_track;
                        marker = BKE_tracking_get_marker(track, framenr);
 
-                       if (MARKER_VISIBLE(sc, marker)) {
+                       if (MARKER_VISIBLE(sc, track, marker)) {
                                if (!act) {
                                        copy_v2_v2(cur_pos, fp ? fp : marker->pos);
 
@@ -1069,7 +1069,7 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
                if ((act_track->flag & TRACK_HIDDEN)==0) {
                        marker = BKE_tracking_get_marker(act_track, framenr);
 
-                       if (MARKER_VISIBLE(sc, marker)) {
+                       if (MARKER_VISIBLE(sc, act_track, marker)) {
                                copy_v2_v2(cur_pos, active_pos ? active_pos : marker->pos);
 
                                draw_marker_areas(sc, act_track, marker, cur_pos, width, height, 1, 1);
@@ -1093,7 +1093,7 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
                        if ((track->flag & TRACK_HIDDEN) == 0 && track->flag & TRACK_HAS_BUNDLE) {
                                marker= BKE_tracking_get_marker(track, framenr);
 
-                               if (MARKER_VISIBLE(sc, marker)) {
+                               if (MARKER_VISIBLE(sc, track, marker)) {
                                        float npos[2];
                                        copy_v4_v4(vec, track->bundle_pos);
                                        vec[3]=1;
@@ -1143,7 +1143,7 @@ static void draw_tracking_tracks(SpaceClip *sc, ARegion *ar, MovieClip *clip,
                        if ((track->flag & TRACK_HIDDEN) == 0) {
                                marker = BKE_tracking_get_marker(track, framenr);
 
-                               if (MARKER_VISIBLE(sc, marker)) {
+                               if (MARKER_VISIBLE(sc, track, marker)) {
                                        int act = track == act_track;
 
                                        copy_v2_v2(cur_pos, fp ? fp : marker->pos);
index 2c1a6ade70aa4c6079e3d3121e695f2867401213..ff0e88a506e216ffc10781828a3a8ee9e84969fb 100644 (file)
@@ -723,7 +723,7 @@ static MovieTrackingTrack *find_nearest_track(SpaceClip *sc, ListBase *tracksbas
        while (cur) {
                MovieTrackingMarker *marker = BKE_tracking_get_marker(cur, sc->user.framenr);
 
-               if (((cur->flag & TRACK_HIDDEN) == 0) && MARKER_VISIBLE(sc, marker)) {
+               if (((cur->flag & TRACK_HIDDEN) == 0) && MARKER_VISIBLE(sc, cur, marker)) {
                        float dist, d1, d2 = FLT_MAX, d3 = FLT_MAX;
 
                        d1= sqrtf((co[0]-marker->pos[0]-cur->offset[0])*(co[0]-marker->pos[0]-cur->offset[0])+
@@ -888,7 +888,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
                if ((track->flag & TRACK_HIDDEN) == 0) {
                        MovieTrackingMarker *marker = BKE_tracking_get_marker(track, sc->user.framenr);
 
-                       if (MARKER_VISIBLE(sc, marker)) {
+                       if (MARKER_VISIBLE(sc, track, marker)) {
                                if (BLI_in_rctf(&rectf, marker->pos[0], marker->pos[1])) {
                                        BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, mode!=GESTURE_MODAL_SELECT);
                                }
@@ -980,7 +980,7 @@ static int circle_select_exec(bContext *C, wmOperator *op)
                if ((track->flag & TRACK_HIDDEN) == 0) {
                        MovieTrackingMarker *marker = BKE_tracking_get_marker(track, sc->user.framenr);
 
-                       if (MARKER_VISIBLE(sc, marker) && marker_inside_ellipse(marker, offset, ellipse)) {
+                       if (MARKER_VISIBLE(sc, track, marker) && marker_inside_ellipse(marker, offset, ellipse)) {
                                BKE_tracking_track_flag(track, TRACK_AREA_ALL, SELECT, mode!=GESTURE_MODAL_SELECT);
 
                                change = TRUE;
@@ -1045,7 +1045,7 @@ static int select_all_exec(bContext *C, wmOperator *op)
                        if (TRACK_VIEW_SELECTED(sc, track)) {
                                marker = BKE_tracking_get_marker(track, framenr);
 
-                               if (MARKER_VISIBLE(sc, marker)) {
+                               if (MARKER_VISIBLE(sc, track, marker)) {
                                        action = SEL_DESELECT;
                                        break;
                                }
@@ -1060,7 +1060,7 @@ static int select_all_exec(bContext *C, wmOperator *op)
                if ((track->flag & TRACK_HIDDEN)==0) {
                        marker = BKE_tracking_get_marker(track, framenr);
 
-                       if (MARKER_VISIBLE(sc, marker)) {
+                       if (MARKER_VISIBLE(sc, track, marker)) {
                                switch (action) {
                                        case SEL_SELECT:
                                                track->flag |= SELECT;