diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-12 21:10:47 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-12 21:10:47 +0400 |
commit | 37612200fd6ce86dcece90c491238b4d6bd0d662 (patch) | |
tree | bc9095e24309cbaafe5d55ad8555bd1bd83be674 /source | |
parent | 55ca0e7636b77a408ea70bf3117eff569e49954b (diff) |
Added options to display only selected tracks and show hidden tracks
in motion tracking dopesheet view.
By default all channels are displaying now.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/tracking.c | 22 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_tracking_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_tracking.c | 14 |
3 files changed, 30 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index 33f7b22f64a..f1b251f54dd 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -3590,6 +3590,8 @@ void BKE_tracking_dopesheet_update(MovieTracking *tracking) ListBase *tracksbase = BKE_tracking_object_tracks(tracking, object); short sort_method = dopesheet->sort_method; short inverse = dopesheet->flag & TRACKING_DOPE_SORT_INVERSE; + short sel_only = dopesheet->flag & TRACKING_DOPE_SELECTED_ONLY; + short show_hidden = dopesheet->flag & TRACKING_DOPE_SHOW_HIDDEN; if (dopesheet->ok) return; @@ -3597,17 +3599,21 @@ void BKE_tracking_dopesheet_update(MovieTracking *tracking) tracking_dopesheet_free(dopesheet); for (track = tracksbase->first; track; track = track->next) { - if (TRACK_SELECTED(track) && (track->flag & TRACK_HIDDEN) == 0) { - MovieTrackingDopesheetChannel *channel; + MovieTrackingDopesheetChannel *channel; - channel = MEM_callocN(sizeof(MovieTrackingDopesheetChannel), "tracking dopesheet channel"); - channel->track = track; + if (!show_hidden && (track->flag & TRACK_HIDDEN) != 0) + continue; - channels_segments_calc(channel); + if (sel_only && !TRACK_SELECTED(track)) + continue; - BLI_addtail(&dopesheet->channels, channel); - dopesheet->tot_channel++; - } + channel = MEM_callocN(sizeof(MovieTrackingDopesheetChannel), "tracking dopesheet channel"); + channel->track = track; + + channels_segments_calc(channel); + + BLI_addtail(&dopesheet->channels, channel); + dopesheet->tot_channel++; } tracking_dopesheet_sort(tracking, sort_method, inverse); diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h index 850d4361ab7..4eb1626f1cb 100644 --- a/source/blender/makesdna/DNA_tracking_types.h +++ b/source/blender/makesdna/DNA_tracking_types.h @@ -358,5 +358,7 @@ enum { /* MovieTrackingDopesheet->flag */ #define TRACKING_DOPE_SORT_INVERSE (1 << 0) +#define TRACKING_DOPE_SELECTED_ONLY (1 << 1) +#define TRACKING_DOPE_SHOW_HIDDEN (1 << 2) #endif diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index a2869a842ee..337f13b5af8 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -1432,6 +1432,20 @@ static void rna_def_trackingDopesheet(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_DOPE_SORT_INVERSE); RNA_def_property_ui_text(prop, "Invert Dopesheet Sort", "Invert sort order of dopesheet channels"); RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, "rna_trackingDopesheet_tagUpdate"); + + /* show_only_selected */ + prop = RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_DOPE_SELECTED_ONLY); + RNA_def_property_ui_text(prop, "Only Selected", "Only include channels relating to selected objects and data"); + RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, "rna_trackingDopesheet_tagUpdate"); + + /* show_hidden */ + prop = RNA_def_property(srna, "show_hidden", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_DOPE_SHOW_HIDDEN); + RNA_def_property_ui_text(prop, "Display Hidden", "Include channels from objects/bone that aren't visible"); + RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, "rna_trackingDopesheet_tagUpdate"); } static void rna_def_tracking(BlenderRNA *brna) |