diff options
author | Alessio Monti di Sopra <a.monti> | 2019-11-30 09:03:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-11-30 09:08:04 +0300 |
commit | dc87d09b8b3249898e0f0d301fa22f03cff9d6d5 (patch) | |
tree | 44b22d9d1046dc30c7ae340eb544712630b7cd6b /source/blender/blenloader | |
parent | f478fef9d6b0609f4bb60fd98e9292b60927b80e (diff) |
UI: allow to hide markers region per editor
Instead of having the option to show marker lines,
make the marker region optional.
- Added a Show Markers entry in the View menu of the animation editors.
- If the markers region is not active then the Marker menu gets hidden.
- Removed marker menu from the driver editor
and don't allow to use marker operators.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 51 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_defaults.c | 13 |
2 files changed, 43 insertions, 21 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 47e55a55ea1..6c8b14ad5c7 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -3394,19 +3394,6 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (!MAIN_VERSION_ATLEAST(bmain, 280, 45)) { - for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { - for (ScrArea *area = screen->areabase.first; area; area = area->next) { - for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { - if (sl->spacetype == SPACE_SEQ) { - SpaceSeq *sseq = (SpaceSeq *)sl; - sseq->flag |= SEQ_SHOW_MARKER_LINES; - } - } - } - } - } - if (!MAIN_VERSION_ATLEAST(bmain, 280, 46)) { /* Add wireframe color. */ if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "char", "wire_color_type")) { @@ -4222,9 +4209,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - { - /* Versioning code until next subversion bump goes here. */ - + if (!MAIN_VERSION_ATLEAST(bmain, 282, 3)) { /* Remove Unified pressure/size and pressure/alpha */ for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { ToolSettings *ts = scene->toolsettings; @@ -4249,5 +4234,39 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } + + /* Make markers region visible by default. */ + for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { + for (ScrArea *area = screen->areabase.first; area; area = area->next) { + for (SpaceLink *sl = area->spacedata.first; sl; sl = sl->next) { + switch (sl->spacetype) { + case SPACE_SEQ: { + SpaceSeq *sseq = (SpaceSeq *)sl; + sseq->flag |= SEQ_SHOW_MARKERS; + break; + } + case SPACE_ACTION: { + SpaceAction *saction = (SpaceAction *)sl; + saction->flag |= SACTION_SHOW_MARKERS; + break; + } + case SPACE_GRAPH: { + SpaceGraph *sipo = (SpaceGraph *)sl; + sipo->flag |= SIPO_SHOW_MARKERS; + break; + } + case SPACE_NLA: { + SpaceNla *snla = (SpaceNla *)sl; + snla->flag |= SNLA_SHOW_MARKERS; + break; + } + } + } + } + } + } + + { + /* Versioning code until next subversion bump goes here. */ } } diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index f2d6db886d3..1c88f6b00af 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -150,10 +150,9 @@ static void blo_update_defaults_screen(bScreen *screen, } } else if (sa->spacetype == SPACE_ACTION) { - /* Show marker lines, hide channels and collapse summary in timelines. */ + /* Show markers region, hide channels and collapse summary in timelines. */ SpaceAction *saction = sa->spacedata.first; - saction->flag |= SACTION_SHOW_MARKER_LINES; - + saction->flag |= SACTION_SHOW_MARKERS; if (saction->mode == SACTCONT_TIMELINE) { saction->ads.flag |= ADS_FLAG_SUMMARY_COLLAPSED; @@ -166,11 +165,15 @@ static void blo_update_defaults_screen(bScreen *screen, } else if (sa->spacetype == SPACE_GRAPH) { SpaceGraph *sipo = sa->spacedata.first; - sipo->flag |= SIPO_MARKER_LINES; + sipo->flag |= SIPO_SHOW_MARKERS; } else if (sa->spacetype == SPACE_NLA) { SpaceNla *snla = sa->spacedata.first; - snla->flag |= SNLA_SHOW_MARKER_LINES; + snla->flag |= SNLA_SHOW_MARKERS; + } + else if (sa->spacetype == SPACE_SEQ) { + SpaceSeq *seq = sa->spacedata.first; + seq->flag |= SEQ_SHOW_MARKERS; } else if (sa->spacetype == SPACE_TEXT) { /* Show syntax and line numbers in Script workspace text editor. */ |