diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-11-20 18:47:51 +0300 |
---|---|---|
committer | Nathan Craddock <nzcraddock@gmail.com> | 2020-11-20 18:47:51 +0300 |
commit | 2afdb4ba8754d690ccad058fdbcab21f83c62b5c (patch) | |
tree | b0a04f9e98be6cd80534fd8131b3b3466d66e620 /source/blender/blenloader/intern/versioning_290.c | |
parent | 96995b2343d96c75e3d03dbfaf8785fb8b28bfc5 (diff) |
Outliner: Object state filter invert toggle
This adds an invert toggle for the outliner object state filters.
There are some cases where we want a filter for invertable states (Selected,
Unselected) and having a single toggle to invert the filter reduces the
number of separate filter types needed. This removes the "Hidden" filter
which can now be replicated with an inverted "Visible" filter.
Differential Revision: https://developer.blender.org/D9598
Diffstat (limited to 'source/blender/blenloader/intern/versioning_290.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index ec39113c4d0..b591f57a7f1 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -1166,5 +1166,20 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } + + /* Replace object hidden filter with inverted object visible filter. */ + LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { + LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { + LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) { + if (space->spacetype == SPACE_OUTLINER) { + SpaceOutliner *space_outliner = (SpaceOutliner *)space; + if (space_outliner->filter_state == SO_FILTER_OB_HIDDEN) { + space_outliner->filter_state = SO_FILTER_OB_VISIBLE; + space_outliner->filter |= SO_FILTER_OB_STATE_INVERSE; + } + } + } + } + } } } |