Camera tracking: switch dopesheet information to lazy calculation
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 3 May 2012 23:15:01 +0000 (23:15 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 3 May 2012 23:15:01 +0000 (23:15 +0000)
All operators which changes tracking data now just tags dopsheet as outdated,
actual re-calculaiton of happens only when this information is actually needed
(like on dopesheet draw).

This makes things a bit faster when there's no dopesheet visible in current
screen and also makes it much easier to update dopesheet using dependency
graph.

Also renamed dopesheet_sort_order to dopesheet_sort_method in rna and internal
stuff which makes much more sense and also correlated with naming in
file browser.

13 files changed:
release/scripts/startup/bl_ui/space_clip.py
source/blender/blenkernel/BKE_tracking.h
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/tracking.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/include/ED_clip.h
source/blender/editors/space_clip/clip_editor.c
source/blender/editors/space_clip/clip_utils.c
source/blender/editors/space_clip/space_clip.c
source/blender/editors/space_clip/tracking_ops.c
source/blender/makesdna/DNA_tracking_types.h
source/blender/makesrna/intern/rna_space.c

index f7ad69a046c5dca7bb896ced0574a85d33fd779b..bd3f087e38a686c67cc52e8f121e88615fd73e26 100644 (file)
@@ -86,7 +86,7 @@ class CLIP_HT_header(Header):
 
             if sc.view == 'DOPESHEET':
                 layout.label(text="Sort by:")
 
             if sc.view == 'DOPESHEET':
                 layout.label(text="Sort by:")
-                layout.prop(sc, "dopesheet_sort_order", text="")
+                layout.prop(sc, "dopesheet_sort_method", text="")
                 layout.prop(sc, "invert_dopesheet_sort", text="Invert")
 
         layout.template_running_jobs()
                 layout.prop(sc, "invert_dopesheet_sort", text="Invert")
 
         layout.template_running_jobs()
index 1432dc151d095360d745d852f58931f7b3abe507..0782396dbaeafc5230134b96174a581eced4b540 100644 (file)
@@ -165,8 +165,8 @@ void BKE_tracking_select_track(struct ListBase *tracksbase, struct MovieTracking
 void BKE_tracking_deselect_track(struct MovieTrackingTrack *track, int area);
 
 /* Dopesheet */
 void BKE_tracking_deselect_track(struct MovieTrackingTrack *track, int area);
 
 /* Dopesheet */
-void BKE_tracking_update_dopesheet(struct MovieTracking *tracking);
-void BKE_tracking_dopesheet_sort(struct MovieTracking *tracking, int sort_order, int inverse);
+void BKE_tracking_dopesheet_tag_update(struct MovieTracking *tracking);
+void BKE_tracking_dopesheet_update(struct MovieTracking *tracking, int sort_method, int inverse);
 
 #define TRACK_SELECTED(track)                          ((track)->flag&SELECT || (track)->pat_flag&SELECT || (track)->search_flag&SELECT)
 
 
 #define TRACK_SELECTED(track)                          ((track)->flag&SELECT || (track)->pat_flag&SELECT || (track)->search_flag&SELECT)
 
index d8cdd728c16e71e62eb82f29566ba5628ed540e7..75e22195c6aaa2081c8be5c771cb73011e146cff 100644 (file)
@@ -72,6 +72,7 @@
 #include "BKE_pointcache.h"
 #include "BKE_scene.h"
 #include "BKE_screen.h"
 #include "BKE_pointcache.h"
 #include "BKE_scene.h"
 #include "BKE_screen.h"
+#include "BKE_tracking.h"
 #include "BKE_utildefines.h"
 
 #include "depsgraph_private.h"
 #include "BKE_utildefines.h"
 
 #include "depsgraph_private.h"
@@ -2580,6 +2581,10 @@ static void dag_id_flush_update(Scene *sce, ID *id)
                }
 
                if (idtype == ID_MC) {
                }
 
                if (idtype == ID_MC) {
+                       MovieClip *clip = (MovieClip *) id;
+
+                       BKE_tracking_dopesheet_tag_update(&clip->tracking);
+
                        for (obt=bmain->object.first; obt; obt= obt->id.next) {
                                bConstraint *con;
                                for (con = obt->constraints.first; con; con=con->next) {
                        for (obt=bmain->object.first; obt; obt= obt->id.next) {
                                bConstraint *con;
                                for (con = obt->constraints.first; con; con=con->next) {
index bb4a7783c82bdc5d2dadd51b27f0b264a92ab55e..be3bda4b6250bf60b67f9e4dba0fcf8ef9d52f68 100644 (file)
@@ -1376,7 +1376,7 @@ void BKE_tracking_sync(MovieTrackingContext *context)
 
        context->sync_frame = newframe;
 
 
        context->sync_frame = newframe;
 
-       BKE_tracking_update_dopesheet(tracking);
+       tracking->dopesheet.ok = FALSE;
 }
 
 void BKE_tracking_sync_user(MovieClipUser *user, MovieTrackingContext *context)
 }
 
 void BKE_tracking_sync_user(MovieClipUser *user, MovieTrackingContext *context)
@@ -3196,13 +3196,59 @@ static void channels_segments_calc(MovieTrackingDopesheetChannel *channel)
        }
 }
 
        }
 }
 
-void BKE_tracking_update_dopesheet(MovieTracking *tracking)
+static void  tracking_dopesheet_sort(MovieTracking *tracking, int sort_method, int inverse)
+{
+       MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
+
+       if (dopesheet->sort_method == sort_method && dopesheet->sort_inverse == inverse)
+               return;
+
+       if (inverse) {
+               if (sort_method == TRACK_SORT_NAME) {
+                       BLI_sortlist(&dopesheet->channels, channels_alpha_inverse_sort);
+               }
+               else if (sort_method == TRACK_SORT_LONGEST) {
+                       BLI_sortlist(&dopesheet->channels, channels_longest_segment_inverse_sort);
+               }
+               else if (sort_method == TRACK_SORT_TOTAL) {
+                       BLI_sortlist(&dopesheet->channels, channels_total_track_inverse_sort);
+               }
+       }
+       else {
+               if (sort_method == TRACK_SORT_NAME) {
+                       BLI_sortlist(&dopesheet->channels, channels_alpha_sort);
+               }
+               else if (sort_method == TRACK_SORT_LONGEST) {
+                       BLI_sortlist(&dopesheet->channels, channels_longest_segment_sort);
+               }
+               else if (sort_method == TRACK_SORT_TOTAL) {
+                       BLI_sortlist(&dopesheet->channels, channels_total_track_sort);
+               }
+       }
+
+       dopesheet->sort_method = sort_method;
+       dopesheet->sort_inverse = inverse;
+}
+
+void BKE_tracking_dopesheet_tag_update(MovieTracking *tracking)
+{
+       MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
+
+       dopesheet->ok = FALSE;
+}
+
+void BKE_tracking_dopesheet_update(MovieTracking *tracking, int sort_method, int inverse)
 {
        MovieTrackingObject *object = BKE_tracking_active_object(tracking);
        MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
        MovieTrackingTrack *track;
        ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object);
 
 {
        MovieTrackingObject *object = BKE_tracking_active_object(tracking);
        MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
        MovieTrackingTrack *track;
        ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object);
 
+       if (dopesheet->ok) {
+               tracking_dopesheet_sort(tracking, sort_method, inverse);
+               return;
+       }
+
        tracking_dopesheet_free(dopesheet);
 
        for (track = tracksbase->first; track; track = track->next) {
        tracking_dopesheet_free(dopesheet);
 
        for (track = tracksbase->first; track; track = track->next) {
@@ -3219,40 +3265,9 @@ void BKE_tracking_update_dopesheet(MovieTracking *tracking)
                }
        }
 
                }
        }
 
-       dopesheet->sort_order = TRACK_SORT_NONE;
-       dopesheet->sort_inverse = -1;
-}
-
-void BKE_tracking_dopesheet_sort(MovieTracking *tracking, int sort_order, int inverse)
-{
-       MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
-
-       if (dopesheet->sort_order == sort_order && dopesheet->sort_inverse == inverse)
-               return;
+       dopesheet->sort_method = TRACK_SORT_NONE;
 
 
-       if (inverse) {
-               if (sort_order == TRACK_SORT_NAME) {
-                       BLI_sortlist(&dopesheet->channels, channels_alpha_inverse_sort);
-               }
-               else if (sort_order == TRACK_SORT_LONGEST) {
-                       BLI_sortlist(&dopesheet->channels, channels_longest_segment_inverse_sort);
-               }
-               else if (sort_order == TRACK_SORT_TOTAL) {
-                       BLI_sortlist(&dopesheet->channels, channels_total_track_inverse_sort);
-               }
-       }
-       else {
-               if (sort_order == TRACK_SORT_NAME) {
-                       BLI_sortlist(&dopesheet->channels, channels_alpha_sort);
-               }
-               else if (sort_order == TRACK_SORT_LONGEST) {
-                       BLI_sortlist(&dopesheet->channels, channels_longest_segment_sort);
-               }
-               else if (sort_order == TRACK_SORT_TOTAL) {
-                       BLI_sortlist(&dopesheet->channels, channels_total_track_sort);
-               }
-       }
+       tracking_dopesheet_sort(tracking, sort_method, inverse);
 
 
-       dopesheet->sort_order = sort_order;
-       dopesheet->sort_inverse = inverse;
+       dopesheet->ok = TRUE;
 }
 }
index afc4989f62041cae1e66836be5d4de90371e3f8a..df71a9f6494d352e5077bf835ccb93b8e483c63d 100644 (file)
@@ -6170,21 +6170,6 @@ static void direct_link_movieTracks(FileData *fd, ListBase *tracksbase)
        }
 }
 
        }
 }
 
-static void direct_link_movieDopesheet(FileData *fd, MovieTrackingDopesheet *dopesheet)
-{
-       MovieTrackingDopesheetChannel *channel;
-
-       link_list(fd, &dopesheet->channels);
-
-       channel = dopesheet->channels.first;
-       while (channel) {
-               channel->track = newdataadr(fd, channel->track);
-               channel->segments = newdataadr(fd, channel->segments);
-
-               channel = channel->next;
-       }
-}
-
 static void direct_link_movieclip(FileData *fd, MovieClip *clip)
 {
        MovieTracking *tracking= &clip->tracking;
 static void direct_link_movieclip(FileData *fd, MovieClip *clip)
 {
        MovieTracking *tracking= &clip->tracking;
@@ -6211,6 +6196,9 @@ static void direct_link_movieclip(FileData *fd, MovieClip *clip)
        clip->tracking.stabilization.scaleibuf= NULL;
        clip->tracking.stabilization.rot_track= newdataadr(fd, clip->tracking.stabilization.rot_track);
 
        clip->tracking.stabilization.scaleibuf= NULL;
        clip->tracking.stabilization.rot_track= newdataadr(fd, clip->tracking.stabilization.rot_track);
 
+       clip->tracking.dopesheet.ok = 0;
+       clip->tracking.dopesheet.channels.first = clip->tracking.dopesheet.channels.last = NULL;
+
        link_list(fd, &tracking->objects);
 
        object= tracking->objects.first;
        link_list(fd, &tracking->objects);
 
        object= tracking->objects.first;
@@ -6220,8 +6208,6 @@ static void direct_link_movieclip(FileData *fd, MovieClip *clip)
 
                object= object->next;
        }
 
                object= object->next;
        }
-
-       direct_link_movieDopesheet(fd, &clip->tracking.dopesheet);
 }
 
 static void lib_link_movieclip(FileData *fd, Main *main)
 }
 
 static void lib_link_movieclip(FileData *fd, Main *main)
index 2199259a3224335cc6d06c10bd89a02ddf324ec3..14c8d42654c45b59cfbd83d473f9246e0138a734 100644 (file)
@@ -2679,19 +2679,6 @@ static void write_movieTracks(WriteData *wd, ListBase *tracks)
        }
 }
 
        }
 }
 
-static void write_movieDopesheet(WriteData *wd, MovieTrackingDopesheet *dopesheet)
-{
-       MovieTrackingDopesheetChannel *channel;
-
-       channel = dopesheet->channels.first;
-       while (channel) {
-               writestruct(wd, DATA, "MovieTrackingDopesheetChannel", 1, channel);
-               writedata(wd, DATA, 2 * channel->tot_segment * sizeof(int), channel->segments);
-
-               channel = channel->next;
-       }
-}
-
 static void write_movieReconstruction(WriteData *wd, MovieTrackingReconstruction *reconstruction)
 {
        if (reconstruction->camnr)
 static void write_movieReconstruction(WriteData *wd, MovieTrackingReconstruction *reconstruction)
 {
        if (reconstruction->camnr)
@@ -2724,8 +2711,6 @@ static void write_movieclips(WriteData *wd, ListBase *idbase)
 
                                object= object->next;
                        }
 
                                object= object->next;
                        }
-
-                       write_movieDopesheet(wd, &tracking->dopesheet);
                }
 
                clip= clip->id.next;
                }
 
                clip= clip->id.next;
index 03e7bd62a2c0776958697d8263c5d5d67f6406a8..302c2940fef63fe4b948e57d469aef66de38f5bf 100644 (file)
@@ -72,8 +72,6 @@ void ED_space_clip_free_texture_buffer(struct SpaceClip *sc);
 
 int ED_space_clip_show_trackedit(struct SpaceClip *sc);
 
 
 int ED_space_clip_show_trackedit(struct SpaceClip *sc);
 
-void ED_space_clip_update_dopesheet(struct SpaceClip *sc);
-
 /* clip_ops.c */
 void ED_operatormacros_clip(void);
 
 /* clip_ops.c */
 void ED_operatormacros_clip(void);
 
index c5c5628abb9d67c5e0924d037559312e2339a98b..a5575cd125e987a12e8fdd98f23884c04847e9be 100644 (file)
@@ -552,11 +552,3 @@ int ED_space_clip_show_trackedit(SpaceClip *sc)
 
        return FALSE;
 }
 
        return FALSE;
 }
-
-void ED_space_clip_update_dopesheet(SpaceClip *sc)
-{
-       MovieClip *clip = sc->clip;
-       MovieTracking *tracking = &clip->tracking;
-
-       BKE_tracking_update_dopesheet(tracking);
-}
index c8ba8be7eaeb22a3af556fefa99bd61981f0ab1c..d45fe834fac8d463af1322fdb12856268a866eae 100644 (file)
@@ -194,11 +194,11 @@ void clip_delete_track(bContext *C, MovieClip *clip, ListBase *tracksbase, Movie
 
        if (update_stab) {
                tracking->stabilization.ok = FALSE;
 
        if (update_stab) {
                tracking->stabilization.ok = FALSE;
-
-               DAG_id_tag_update(&clip->id, 0);
                WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip);
        }
 
                WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip);
        }
 
+       DAG_id_tag_update(&clip->id, 0);
+
        if (has_bundle)
                WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, NULL);
 }
        if (has_bundle)
                WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, NULL);
 }
index 82f76efacaacc6bb21f3481b3832562b9fe90a34..b92b45752efa4db3ff3fe3c037a6437da50dc772 100644 (file)
@@ -1135,7 +1135,7 @@ static void dopesheet_area_draw(const bContext *C, ARegion *ar)
        View2DScrollers *scrollers;
        short unit = 0;
 
        View2DScrollers *scrollers;
        short unit = 0;
 
-       BKE_tracking_dopesheet_sort(&clip->tracking, sc->dope_sort, sc->dope_flag & SC_DOPE_SORT_INVERSE);
+       BKE_tracking_dopesheet_update(&clip->tracking, sc->dope_sort, sc->dope_flag & SC_DOPE_SORT_INVERSE);
 
        /* clear and setup matrix */
        UI_ThemeClearColor(TH_BACK);
 
        /* clear and setup matrix */
        UI_ThemeClearColor(TH_BACK);
@@ -1194,7 +1194,7 @@ static void clip_channels_area_draw(const bContext *C, ARegion *ar)
        View2D *v2d = &ar->v2d;
        View2DScrollers *scrollers;
 
        View2D *v2d = &ar->v2d;
        View2DScrollers *scrollers;
 
-       BKE_tracking_dopesheet_sort(&clip->tracking, sc->dope_sort, sc->dope_flag & SC_DOPE_SORT_INVERSE);
+       BKE_tracking_dopesheet_update(&clip->tracking, sc->dope_sort, sc->dope_flag & SC_DOPE_SORT_INVERSE);
 
        /* clear and setup matrix */
        UI_ThemeClearColor(TH_BACK);
 
        /* clear and setup matrix */
        UI_ThemeClearColor(TH_BACK);
index 2c9b61ed1efed0053857b096f16c35e9c7f81637..2c1a6ade70aa4c6079e3d3121e695f2867401213 100644 (file)
@@ -95,8 +95,6 @@ static void add_marker(SpaceClip *sc, float x, float y)
        BKE_tracking_select_track(tracksbase, track, TRACK_AREA_ALL, 0);
 
        clip->tracking.act_track = track;
        BKE_tracking_select_track(tracksbase, track, TRACK_AREA_ALL, 0);
 
        clip->tracking.act_track = track;
-
-       ED_space_clip_update_dopesheet(sc);
 }
 
 static int add_marker_exec(bContext *C, wmOperator *op)
 }
 
 static int add_marker_exec(bContext *C, wmOperator *op)
@@ -176,8 +174,6 @@ static int delete_track_exec(bContext *C, wmOperator *UNUSED(op))
        /* nothing selected now, unlock view so it can be scrolled nice again */
        sc->flag &= ~SC_LOCK_SELECTION;
 
        /* nothing selected now, unlock view so it can be scrolled nice again */
        sc->flag &= ~SC_LOCK_SELECTION;
 
-       ED_space_clip_update_dopesheet(sc);
-
        return OPERATOR_FINISHED;
 }
 
        return OPERATOR_FINISHED;
 }
 
@@ -229,8 +225,6 @@ static int delete_marker_exec(bContext *C, wmOperator *UNUSED(op))
                sc->flag &= ~SC_LOCK_SELECTION;
        }
 
                sc->flag &= ~SC_LOCK_SELECTION;
        }
 
-       ED_space_clip_update_dopesheet(sc);
-
        return OPERATOR_FINISHED;
 }
 
        return OPERATOR_FINISHED;
 }
 
@@ -795,8 +789,9 @@ static int mouse_select(bContext *C, float co[2], int extend)
                sc->ylockof = 0.0f;
        }
 
                sc->ylockof = 0.0f;
        }
 
+       BKE_tracking_dopesheet_tag_update(tracking);
+
        WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
        WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
-       ED_space_clip_update_dopesheet(sc);
 
        return OPERATOR_FINISHED;
 }
 
        return OPERATOR_FINISHED;
 }
@@ -868,8 +863,9 @@ static int border_select_exec(bContext *C, wmOperator *op)
 {
        SpaceClip *sc = CTX_wm_space_clip(C);
        MovieClip *clip = ED_space_clip(sc);
 {
        SpaceClip *sc = CTX_wm_space_clip(C);
        MovieClip *clip = ED_space_clip(sc);
+       MovieTracking *tracking = &clip->tracking;
        MovieTrackingTrack *track;
        MovieTrackingTrack *track;
-       ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
+       ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
        rcti rect;
        rctf rectf;
        int change = FALSE, mode, extend;
        rcti rect;
        rctf rectf;
        int change = FALSE, mode, extend;
@@ -908,7 +904,7 @@ static int border_select_exec(bContext *C, wmOperator *op)
        }
 
        if (change) {
        }
 
        if (change) {
-               ED_space_clip_update_dopesheet(sc);
+               BKE_tracking_dopesheet_tag_update(tracking);
 
                WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
 
 
                WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
 
@@ -956,8 +952,9 @@ static int circle_select_exec(bContext *C, wmOperator *op)
        SpaceClip *sc = CTX_wm_space_clip(C);
        MovieClip *clip = ED_space_clip(sc);
        ARegion *ar = CTX_wm_region(C);
        SpaceClip *sc = CTX_wm_space_clip(C);
        MovieClip *clip = ED_space_clip(sc);
        ARegion *ar = CTX_wm_region(C);
+       MovieTracking *tracking = &clip->tracking;
        MovieTrackingTrack *track;
        MovieTrackingTrack *track;
-       ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
+       ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
        int x, y, radius, width, height, mode, change = FALSE;
        float zoomx, zoomy, offset[2], ellipse[2];
 
        int x, y, radius, width, height, mode, change = FALSE;
        float zoomx, zoomy, offset[2], ellipse[2];
 
@@ -994,7 +991,7 @@ static int circle_select_exec(bContext *C, wmOperator *op)
        }
 
        if (change) {
        }
 
        if (change) {
-               ED_space_clip_update_dopesheet(sc);
+               BKE_tracking_dopesheet_tag_update(tracking);
 
                WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
 
 
                WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
 
@@ -1033,9 +1030,10 @@ static int select_all_exec(bContext *C, wmOperator *op)
 {
        SpaceClip *sc = CTX_wm_space_clip(C);
        MovieClip *clip = ED_space_clip(sc);
 {
        SpaceClip *sc = CTX_wm_space_clip(C);
        MovieClip *clip = ED_space_clip(sc);
+       MovieTracking *tracking = &clip->tracking;
        MovieTrackingTrack *track = NULL;       /* selected track */
        MovieTrackingMarker *marker;
        MovieTrackingTrack *track = NULL;       /* selected track */
        MovieTrackingMarker *marker;
-       ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
+       ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
        int action = RNA_enum_get(op->ptr, "action");
        int framenr = sc->user.framenr;
        int has_selection = FALSE;
        int action = RNA_enum_get(op->ptr, "action");
        int framenr = sc->user.framenr;
        int has_selection = FALSE;
@@ -1092,7 +1090,7 @@ static int select_all_exec(bContext *C, wmOperator *op)
        if (!has_selection)
                sc->flag &= ~SC_LOCK_SELECTION;
 
        if (!has_selection)
                sc->flag &= ~SC_LOCK_SELECTION;
 
-       ED_space_clip_update_dopesheet(sc);
+       BKE_tracking_dopesheet_tag_update(tracking);
 
        WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
 
 
        WM_event_add_notifier(C, NC_GEOM|ND_SELECT, NULL);
 
@@ -1174,7 +1172,7 @@ static int select_groped_exec(bContext *C, wmOperator *op)
                track = track->next;
        }
 
                track = track->next;
        }
 
-       ED_space_clip_update_dopesheet(sc);
+       BKE_tracking_dopesheet_tag_update(tracking);
 
        WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip);
 
 
        WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, clip);
 
@@ -2745,7 +2743,7 @@ static int hide_tracks_exec(bContext *C, wmOperator *op)
                sc->flag &= ~SC_LOCK_SELECTION;
        }
 
                sc->flag &= ~SC_LOCK_SELECTION;
        }
 
-       BKE_tracking_update_dopesheet(tracking);
+       BKE_tracking_dopesheet_tag_update(tracking);
 
        WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, NULL);
 
 
        WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, NULL);
 
@@ -2776,7 +2774,8 @@ static int hide_tracks_clear_exec(bContext *C, wmOperator *UNUSED(op))
 {
        SpaceClip *sc = CTX_wm_space_clip(C);
        MovieClip *clip = ED_space_clip(sc);
 {
        SpaceClip *sc = CTX_wm_space_clip(C);
        MovieClip *clip = ED_space_clip(sc);
-       ListBase *tracksbase = BKE_tracking_get_tracks(&clip->tracking);
+       MovieTracking *tracking = &clip->tracking;
+       ListBase *tracksbase = BKE_tracking_get_tracks(tracking);
        MovieTrackingTrack *track;
 
        track = tracksbase->first;
        MovieTrackingTrack *track;
 
        track = tracksbase->first;
@@ -2786,6 +2785,8 @@ static int hide_tracks_clear_exec(bContext *C, wmOperator *UNUSED(op))
                track = track->next;
        }
 
                track = track->next;
        }
 
+       BKE_tracking_dopesheet_tag_update(tracking);
+
        WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, NULL);
 
        return OPERATOR_FINISHED;
        WM_event_add_notifier(C, NC_MOVIECLIP|ND_DISPLAY, NULL);
 
        return OPERATOR_FINISHED;
index 4e2b3c46aa4a91ec48065518ad52f0c4780e225f..6bf059c7ecb7dad0f5b40290c12522cf64c82bf8 100644 (file)
@@ -205,10 +205,12 @@ typedef struct MovieTrackingDopesheetChannel {
 } MovieTrackingDopesheetChannel;
 
 typedef struct MovieTrackingDopesheet {
 } MovieTrackingDopesheetChannel;
 
 typedef struct MovieTrackingDopesheet {
+       int ok, pad;                            /* flag if dopesheet information is still relevant */
+
        ListBase channels;
        int tot_channel;
 
        ListBase channels;
        int tot_channel;
 
-       short sort_order;                       /* order in which tracks are stored */
+       short sort_method;                      /* method to be used to sort tracks */
        short sort_inverse;                     /* order of tracks is inverted */
 } MovieTrackingDopesheet;
 
        short sort_inverse;                     /* order of tracks is inverted */
 } MovieTrackingDopesheet;
 
index bc2e1b7e1f3987061a58ead8f3599b94c2bf624d..51f5cdcda851089bd25361209711fd04f91f9175 100644 (file)
@@ -3122,10 +3122,10 @@ static void rna_def_space_clip(BlenderRNA *brna)
        /* ** dopesheet ** */
 
        /* dopesheet sort */
        /* ** dopesheet ** */
 
        /* dopesheet sort */
-       prop = RNA_def_property(srna, "dopesheet_sort_order", PROP_ENUM, PROP_NONE);
+       prop = RNA_def_property(srna, "dopesheet_sort_method", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "dope_sort");
        RNA_def_property_enum_items(prop, dope_sort_items);
        RNA_def_property_enum_sdna(prop, NULL, "dope_sort");
        RNA_def_property_enum_items(prop, dope_sort_items);
-       RNA_def_property_ui_text(prop, "Dopesheet Sort Field", "Field used to sort channels in dopesheet view");
+       RNA_def_property_ui_text(prop, "Dopesheet Sort Field", "Method to be used to sort channels in dopesheet view");
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
 
        /* invert_dopesheet_sort */
        RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL);
 
        /* invert_dopesheet_sort */