diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-05-03 23:28:41 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-05-03 23:28:41 +0400 |
commit | b1006fb949d5b437f7ab0514ee779ba24fcfc1f8 (patch) | |
tree | 9e30e514bdba81d5955691bd4722235beea2d58b /source/blender/makesrna/intern/rna_space.c | |
parent | 5821c2973ec6a7cc6abc25ac75e85e84dc176411 (diff) |
Clip editor: sort order for dopesheet channels
Supported sorting by name, longest tracked segment and total tracked frames.
Internally tracks are stored in Tracking datablock, but sort order is
a clip editor space property and sorting happens on clip editor draw.
If there's no dopesheet opened with different sort orders it's not
a problem due to re-sorting wouldn't happen.
Also fixed draw issue of tracked segments introduced in previous commit.
Diffstat (limited to 'source/blender/makesrna/intern/rna_space.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 47bad8f31e5..bc2e1b7e1f3 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2934,6 +2934,12 @@ static void rna_def_space_clip(BlenderRNA *brna) {SC_VIEW_DOPESHEET, "DOPESHEET", ICON_ACTION, "Dopesheet", "Dopesheet view for tracking data"}, {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem dope_sort_items[] = { + {SC_DOPE_SORT_NAME, "NAME", 0, "Name", "Sort channels by their names"}, + {SC_DOPE_SORT_LONGEST, "LONGEST", 0, "Longest", "Sort channels by longest tracked segment"}, + {SC_DOPE_SORT_TOTAL, "TOTAL", 0, "Total", "Sort channels by overall amount of tracked segments"}, + {0, NULL, 0, NULL, NULL}}; + srna = RNA_def_struct(brna, "SpaceClipEditor", "Space"); RNA_def_struct_sdna(srna, "SpaceClip"); RNA_def_struct_ui_text(srna, "Space Clip Editor", "Clip editor space data"); @@ -3112,6 +3118,21 @@ static void rna_def_space_clip(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_SECONDS); RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames"); RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, NULL); + + /* ** dopesheet ** */ + + /* dopesheet sort */ + prop = RNA_def_property(srna, "dopesheet_sort_order", 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_ui_text(prop, "Dopesheet Sort Field", "Field used to sort channels in dopesheet view"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); + + /* invert_dopesheet_sort */ + prop = RNA_def_property(srna, "invert_dopesheet_sort", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "dope_flag", SC_DOPE_SORT_INVERSE); + RNA_def_property_ui_text(prop, "Invert Dopesheet Sort", "Invert sort order of dopesheet channels"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CLIP, NULL); } |