diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-03-06 18:07:14 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-03-06 18:07:40 +0400 |
commit | 3d2b53031503d59aa3a96ec2164896aec4c4168e (patch) | |
tree | c1c57b462dbc473b4227ce070bba0a0f36c90b7e /source/blender/editors | |
parent | a28dce6cc8d2b8338f220909bacc8ef7b1018677 (diff) |
Hiding plane tracks was never implemented
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_clip/clip_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_clip/tracking_ops.c | 36 | ||||
-rw-r--r-- | source/blender/editors/space_clip/tracking_select.c | 11 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 10 |
4 files changed, 47 insertions, 14 deletions
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index c8a49a68290..a17cf0e406d 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -1311,7 +1311,9 @@ static void draw_tracking_tracks(SpaceClip *sc, Scene *scene, ARegion *ar, Movie plane_track; plane_track = plane_track->next) { - draw_plane_track(sc, scene, plane_track, framenr, plane_track == active_plane_track, width, height); + if ((plane_track->flag & PLANE_TRACK_HIDDEN) == 0) { + draw_plane_track(sc, scene, plane_track, framenr, plane_track == active_plane_track, width, height); + } } if (sc->user.render_flag & MCLIP_PROXY_RENDER_UNDISTORT) { diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 6f44b47ed61..85e420f3e86 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -252,7 +252,7 @@ static int delete_track_exec(bContext *C, wmOperator *UNUSED(op)) { next_plane_track = plane_track->next; - if (plane_track->flag & SELECT) { + if (PLANE_TRACK_VIEW_SELECTED(plane_track)) { BKE_tracking_plane_track_free(plane_track); BLI_freelinkN(plane_tracks_base, plane_track); changed = true; @@ -333,7 +333,7 @@ static int delete_marker_exec(bContext *C, wmOperator *UNUSED(op)) { plane_track_next = plane_track->next; - if (plane_track->flag & SELECT) { + if (PLANE_TRACK_VIEW_SELECTED(plane_track)) { MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get_exact(plane_track, framenr); if (plane_marker) { @@ -2792,9 +2792,12 @@ static int hide_tracks_exec(bContext *C, wmOperator *op) SpaceClip *sc = CTX_wm_space_clip(C); MovieClip *clip = ED_space_clip_get_clip(sc); MovieTrackingTrack *track; + MovieTrackingPlaneTrack *plane_track; MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); + ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking); MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking); + MovieTrackingPlaneTrack *act_plane_track = BKE_tracking_plane_track_get_active(&clip->tracking); int unselected; unselected = RNA_boolean_get(op->ptr, "unselected"); @@ -2819,6 +2822,22 @@ static int hide_tracks_exec(bContext *C, wmOperator *op) sc->flag &= ~SC_LOCK_SELECTION; } + for (plane_track = plane_tracks_base->first; + plane_track; + plane_track = plane_track->next) + { + if (unselected == 0 && plane_track->flag & SELECT) { + plane_track->flag |= PLANE_TRACK_HIDDEN; + } + else if (unselected == 1 && (plane_track->flag & SELECT) == 0) { + plane_track->flag |= PLANE_TRACK_HIDDEN; + } + } + + if (act_plane_track && act_plane_track->flag & TRACK_HIDDEN) { + clip->tracking.act_plane_track = NULL; + } + BKE_tracking_dopesheet_tag_update(tracking); WM_event_add_notifier(C, NC_MOVIECLIP | ND_DISPLAY, NULL); @@ -2852,7 +2871,9 @@ static int hide_tracks_clear_exec(bContext *C, wmOperator *UNUSED(op)) MovieClip *clip = ED_space_clip_get_clip(sc); MovieTracking *tracking = &clip->tracking; ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); + ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(tracking); MovieTrackingTrack *track; + MovieTrackingPlaneTrack *plane_track; track = tracksbase->first; while (track) { @@ -2861,6 +2882,13 @@ static int hide_tracks_clear_exec(bContext *C, wmOperator *UNUSED(op)) track = track->next; } + for (plane_track = plane_tracks_base->first; + plane_track; + plane_track = plane_track->next) + { + plane_track->flag &= ~PLANE_TRACK_HIDDEN; + } + BKE_tracking_dopesheet_tag_update(tracking); WM_event_add_notifier(C, NC_MOVIECLIP | ND_DISPLAY, NULL); @@ -3912,7 +3940,7 @@ static MovieTrackingPlaneTrack *tracking_plane_marker_check_slide(bContext *C, c plane_track; plane_track = plane_track->next) { - if (plane_track->flag & SELECT) { + if (PLANE_TRACK_VIEW_SELECTED(plane_track)) { MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get(plane_track, framenr); bool ok = false; int i; @@ -4191,7 +4219,7 @@ static void keyframe_set_flag(bContext *C, bool set) } for (plane_track = plane_tracks_base->first; plane_track; plane_track = plane_track->next) { - if (plane_track->flag & SELECT) { + if (PLANE_TRACK_VIEW_SELECTED(plane_track)) { if (set) { MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_ensure(plane_track, framenr); if (plane_marker->flag & PLANE_MARKER_TRACKED) { diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c index 65b7a5dee65..449cccaa643 100644 --- a/source/blender/editors/space_clip/tracking_select.c +++ b/source/blender/editors/space_clip/tracking_select.c @@ -349,7 +349,7 @@ static int mouse_select(bContext *C, float co[2], int extend) delect_all_tracks(tracksbase); } - if (plane_track->flag & SELECT) { + if (PLANE_TRACK_VIEW_SELECTED(plane_track)) { if (extend) { plane_track->flag &= ~SELECT; } @@ -846,7 +846,7 @@ static int select_all_exec(bContext *C, wmOperator *op) plane_track; plane_track = plane_track->next) { - if (plane_track->flag & SELECT) { + if (PLANE_TRACK_VIEW_SELECTED(plane_track)) { action = SEL_DESELECT; break; } @@ -898,10 +898,9 @@ static int select_all_exec(bContext *C, wmOperator *op) plane_track->flag ^= SELECT; break; } - } - - if (plane_track->flag & SELECT) { - has_selection = true; + if (plane_track->flag & SELECT) { + has_selection = true; + } } } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index beb49a5443e..f593a10409b 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -5347,7 +5347,11 @@ static void special_aftertrans_update__movieclip(bContext *C, TransInfo *t) { bool do_update = false; - do_update |= (plane_track->flag & SELECT) != 0; + if (plane_track->flag & PLANE_TRACK_HIDDEN) { + continue; + } + + do_update |= PLANE_TRACK_VIEW_SELECTED(plane_track) != 0; if (do_update == false) { if ((plane_track->flag & PLANE_TRACK_AUTOKEY) == 0) { int i; @@ -6301,7 +6305,7 @@ static void createTransTrackingTracksData(bContext *C, TransInfo *t) plane_track; plane_track = plane_track->next) { - if (plane_track->flag & SELECT) { + if (PLANE_TRACK_VIEW_SELECTED(plane_track)) { t->total += 4; } } @@ -6354,7 +6358,7 @@ static void createTransTrackingTracksData(bContext *C, TransInfo *t) plane_track; plane_track = plane_track->next) { - if (plane_track->flag & SELECT) { + if (PLANE_TRACK_VIEW_SELECTED(plane_track)) { planeTrackToTransData(framenr, td, td2d, tdt, plane_track, aspx, aspy); td += 4; td2d += 4; |