diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-01-19 16:39:54 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-01-19 17:13:10 +0300 |
commit | 37913cf5326a732cb94c28f96c1deb8f3965c846 (patch) | |
tree | 01eb20a01d162c6e827e6b1e34500a849dd369ce /source/blender/blenloader | |
parent | 76f374052c17c61239e1487048eb3229ff72053a (diff) |
Outliner Filtering System + Cleanup
User notes:
The outliner so far was a great system to handle the object oriented workflow
we had in Blender prior to 2.8. However with the introduction of collections
the bloated ammount of data we were exposed at a given time was eventually
getting on the way of fully utilizing the outliner to manage collections and
their objects.
We hope that with this filtering system the user can put together the outliner
with whichever options he or she seem fit for a given task.
Features:
* Collection filter: In case users are only focused on objects.
* Object filter: Allow users to focus on collections only.
* (Object) content filter: Modifiers, mesh, contrainst, materials, ...
* (Object) children filter: Hide object children [1].
* Object State (visible, active, selected).
* Compact header: hide search options under a search toggle.
* Preserve scrolling position before/after filtering [2].
[1] - Note we still need to be able to tell if a children of an object is in a
collection, or if the parent object is the only one in the collection.
This in fact was one of the first motivations for this patch. But it is to
be addressed separately now that we can at least hide children away.
[2] - We look at the top-most collection in the outliner, and try to find it again
after the filtering and make sure it is in the same position as before.
This works nice now. But to work REALLY, REALLY nice we need to also store
the previous filter options to be sure the element we try to keep on top
was valid for both old and new filters. I would rather do this later though
since this smell a lot like feature creeping ;)
Remove no longer needed display options:
* Current Scene (replaced by View Layer/Collections)
* Visible (replaced by filter)
* Selected (same)
* Active (same)
* Same Type (same-ish)
How about All Scenes? I have a patch that will come next to replace the current
behaviour and focus only on compositing. So basically stop showing the objects
and show only view layers, their passes and collections, besides freestyle.
Also, while at this I'm also reorganizing the menu to keep View Layer and
Collections on top.
Developer notes:
* Unlike the per-object filtering, for collections we need to filter at tree
creation time, to prevent duplication of objects in the outliner.
Acknowledgements:
Thanks Pablo Vazquez for helping testing, thinking some design questions
together and pushing this to its final polished state as you see here.
Thanks Sergey Sharybin and Julian Eisel for code review. Julian couldn't do a
final review pass after I addressed his concerns. So blame is on me for any
issue I may be introducing here. Sergey was the author of the "preserve
scrolling position" idea. I'm happy with how it is working, thank you.
Reviewers: sergey, Severin, venomgfx
Subscribers: lichtwerk, duarteframos
Differential Revision: https://developer.blender.org/D2992
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_260.c | 10 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 33 |
2 files changed, 40 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c index 77542d8deb9..bf5b19b92ee 100644 --- a/source/blender/blenloader/intern/versioning_260.c +++ b/source/blender/blenloader/intern/versioning_260.c @@ -2453,9 +2453,13 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main) if (sl->spacetype == SPACE_OUTLINER) { SpaceOops *so = (SpaceOops *)sl; - if (!ELEM(so->outlinevis, SO_ALL_SCENES, SO_CUR_SCENE, SO_VISIBLE, SO_SELECTED, SO_ACTIVE, - SO_SAME_TYPE, SO_GROUPS, SO_LIBRARIES, SO_SEQUENCE, SO_DATABLOCKS, - SO_USERDEF)) + if (!ELEM(so->outlinevis, + SO_ALL_SCENES, + SO_GROUPS, + SO_LIBRARIES, + SO_SEQUENCE, + SO_DATABLOCKS, + SO_USERDEF)) { so->outlinevis = SO_ALL_SCENES; } diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 49cf86fc84c..9a4d171f7fa 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -883,4 +883,37 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main) } } } + + { + if (DNA_struct_elem_find(fd->filesdna, "SpaceOops", "int", "filter") == false) { + bScreen *sc; + ScrArea *sa; + SpaceLink *sl; + + /* Update files using invalid (outdated) outlinevis Outliner values. */ + for (sc = main->screen.first; sc; sc = sc->id.next) { + for (sa = sc->areabase.first; sa; sa = sa->next) { + for (sl = sa->spacedata.first; sl; sl = sl->next) { + if (sl->spacetype == SPACE_OUTLINER) { + SpaceOops *so = (SpaceOops *)sl; + + if (!ELEM(so->outlinevis, + SO_ALL_SCENES, + SO_GROUPS, + SO_LIBRARIES, + SO_SEQUENCE, + SO_DATABLOCKS, + SO_USERDEF, + SO_ID_ORPHANS, + SO_VIEW_LAYER, + SO_COLLECTIONS)) + { + so->outlinevis = SO_VIEW_LAYER; + } + } + } + } + } + } + } } |