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 /release/scripts/startup/bl_ui/space_outliner.py | |
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 'release/scripts/startup/bl_ui/space_outliner.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_outliner.py | 56 |
1 files changed, 51 insertions, 5 deletions
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index d97f057a903..5b4a7d34264 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -28,8 +28,10 @@ class OUTLINER_HT_header(Header): layout = self.layout space = context.space_data + display_mode = space.display_mode scene = context.scene ks = context.scene.keying_sets.active + support_filters = display_mode in {'COLLECTIONS', 'VIEW_LAYER'} row = layout.row(align=True) row.template_header() @@ -38,13 +40,9 @@ class OUTLINER_HT_header(Header): layout.prop(space, "display_mode", text="") - row = layout.row(align=True) - row.prop(space, "filter_text", icon='VIEWZOOM', text="") - row.prop(space, "use_filter_complete", text="") - row.prop(space, "use_filter_case_sensitive", text="") - if space.display_mode == 'DATABLOCKS': layout.separator() + row = layout.row(align=True) row.operator("outliner.keyingset_add_selected", icon='ZOOMIN', text="") row.operator("outliner.keyingset_remove_selected", icon='ZOOMOUT', text="") @@ -60,6 +58,54 @@ class OUTLINER_HT_header(Header): row = layout.row() row.label(text="No Keying Set Active") + row = layout.row(align=True) + row.prop(space, "use_filter_search", text="") + if space.use_filter_search: + row.prop(space, "filter_text", text="") + row.prop(space, "use_filter_complete", text="") + row.prop(space, "use_filter_case_sensitive", text="") + + if support_filters: + row.separator() + + row.prop(space, "use_filters", text="") + if space.use_filters: + row.separator() + row.prop(space, "use_filter_collection", text="") + row.prop(space, "use_filter_object", text="") + sub = row.row(align=True) + sub.active = space.use_filter_object + sub.prop(space, "use_filter_object_content", text="") + sub.prop(space, "use_filter_children", text="") + + sub.separator() + sub.prop(space, "use_filter_object_type", text="") + + if space.use_filter_object_type: + if bpy.data.meshes: + sub.prop(space, "use_filter_object_mesh", text="") + if bpy.data.armatures: + sub.prop(space, "use_filter_object_armature", text="") + if bpy.data.lamps: + sub.prop(space, "use_filter_object_lamp", text="") + if bpy.data.cameras: + sub.prop(space, "use_filter_object_camera", text="") + + sub.prop(space, "use_filter_object_empty", text="") + + if bpy.data.curves or \ + bpy.data.metaballs or \ + bpy.data.lightprobes or \ + bpy.data.lattices or \ + bpy.data.fonts or bpy.data.speakers: + sub.prop(space, "use_filter_object_others", text="") + + sub.separator() + sub.prop(space, "use_filter_object_state", text="") + + if space.use_filter_object_state: + sub.prop(space, "filter_state", text="", expand=True) + class OUTLINER_MT_editor_menus(Menu): bl_idname = "OUTLINER_MT_editor_menus" |