Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2018-01-19 16:39:54 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-01-19 17:13:10 +0300
commit37913cf5326a732cb94c28f96c1deb8f3965c846 (patch)
tree01eb20a01d162c6e827e6b1e34500a849dd369ce /source/blender/makesrna/intern/rna_space.c
parent76f374052c17c61239e1487048eb3229ff72053a (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/makesrna/intern/rna_space.c')
-rw-r--r--source/blender/makesrna/intern/rna_space.c115
1 files changed, 105 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 92fb77da1bf..25434a696b1 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2101,13 +2101,10 @@ static void rna_def_space_outliner(BlenderRNA *brna)
PropertyRNA *prop;
static const EnumPropertyItem display_mode_items[] = {
- {SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", "Display data-blocks in all scenes"},
- {SO_CUR_SCENE, "CURRENT_SCENE", 0, "Current Scene", "Display data-blocks in current scene"},
- {SO_VISIBLE, "VISIBLE_LAYERS", 0, "Visible Layers", "Display data-blocks in visible layers"},
- {SO_SELECTED, "SELECTED", 0, "Selected", "Display data-blocks of selected, visible objects"},
- {SO_ACTIVE, "ACTIVE", 0, "Active", "Display data-blocks of active object"},
- {SO_SAME_TYPE, "SAME_TYPES", 0, "Same Types",
- "Display data-blocks of all objects of same type as selected object"},
+ {SO_VIEW_LAYER, "VIEW_LAYER", 0, "View Layer", "Display the collections of the active view layer"},
+ {SO_COLLECTIONS, "COLLECTIONS", 0, "Collections", "Display all collections based on the "
+ "master collection hierarchy"},
+ {SO_ALL_SCENES, "ALL_SCENES", 0, "All Scenes", "Display composition related data in all scenes"},
{SO_GROUPS, "GROUPS", 0, "Groups", "Display groups and their data-blocks"},
{SO_SEQUENCE, "SEQUENCE", 0, "Sequence", "Display sequence data-blocks"},
{SO_LIBRARIES, "LIBRARIES", 0, "Blender File", "Display data of current file and linked libraries"},
@@ -2115,9 +2112,13 @@ static void rna_def_space_outliner(BlenderRNA *brna)
{SO_USERDEF, "USER_PREFERENCES", 0, "User Preferences", "Display user preference data"},
{SO_ID_ORPHANS, "ORPHAN_DATA", 0, "Orphan Data",
"Display data-blocks which are unused and/or will be lost when the file is reloaded"},
- {SO_VIEW_LAYER, "VIEW_LAYER", 0, "View Layer", "Display the collections of the active view layer"},
- {SO_COLLECTIONS, "COLLECTIONS", 0, "Collections", "Display all collections based on the "
- "master collection hierarchy"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
+ static const EnumPropertyItem filter_state_items[] = {
+ {SO_FILTER_OB_VISIBLE, "VISIBLE", ICON_RESTRICT_VIEW_OFF, "Visible", "Show visible objects"},
+ {SO_FILTER_OB_SELECTED, "SELECTED", ICON_RESTRICT_SELECT_OFF, "Selected", "Show selected objects"},
+ {SO_FILTER_OB_ACTIVE, "ACTIVE", ICON_LAYER_ACTIVE, "Active", "Show only the active object"},
{0, NULL, 0, NULL, NULL}
};
@@ -2159,6 +2160,100 @@ static void rna_def_space_outliner(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS);
RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show column");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
+ /* Filters. */
+ prop = RNA_def_property(srna, "use_filter_search", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "filter", SO_FILTER_SEARCH);
+ RNA_def_property_ui_text(prop, "Search Name", "Filter searched elements");
+ RNA_def_property_ui_icon(prop, ICON_VIEWZOOM, 0);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
+ prop = RNA_def_property(srna, "use_filters", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "filter", SO_FILTER_ENABLE);
+ RNA_def_property_ui_text(prop, "Use Filters", "Use filters");
+ RNA_def_property_ui_icon(prop, ICON_FILTER, 0);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
+ prop = RNA_def_property(srna, "use_filter_object", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OBJECT);
+ RNA_def_property_ui_text(prop, "Filter Objects", "Show objects");
+ RNA_def_property_ui_icon(prop, ICON_OBJECT_DATA, 0);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
+ prop = RNA_def_property(srna, "use_filter_object_content", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_CONTENT);
+ RNA_def_property_ui_text(prop, "Filter Objects Contents", "Show what is inside the objects elements");
+ RNA_def_property_ui_icon(prop, ICON_MODIFIER, 0);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
+ prop = RNA_def_property(srna, "use_filter_children", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_CHILDREN);
+ RNA_def_property_ui_text(prop, "Filter Objects Children", "Show children");
+ RNA_def_property_ui_icon(prop, ICON_PLUS, 0);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
+ prop = RNA_def_property(srna, "use_filter_collection", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_COLLECTION);
+ RNA_def_property_ui_text(prop, "Filter Collections", "Show collections");
+ RNA_def_property_ui_icon(prop, ICON_COLLAPSEMENU, 0);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
+ /* Filters object state. */
+ prop = RNA_def_property(srna, "use_filter_object_state", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "filter", SO_FILTER_OB_STATE);
+ RNA_def_property_ui_text(prop, "Filter Object State", "Filter objects based on their state (visible, ...)."
+ "This can be slow");
+ RNA_def_property_ui_icon(prop, ICON_LAYER_USED, 0);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
+ prop = RNA_def_property(srna, "filter_state", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "filter_state");
+ RNA_def_property_enum_items(prop, filter_state_items);
+ RNA_def_property_ui_text(prop, "State Filter", "");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
+ /* Filters object type. */
+ prop = RNA_def_property(srna, "use_filter_object_type", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "filter", SO_FILTER_OB_TYPE);
+ RNA_def_property_ui_text(prop, "Filter Object Type", "Show specific objects types");
+ RNA_def_property_ui_icon(prop, ICON_MESH_CUBE, 0);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
+ prop = RNA_def_property(srna, "use_filter_object_mesh", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_MESH);
+ RNA_def_property_ui_text(prop, "Show Meshes", "Show mesh objects");
+ RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_MESH, 0);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
+ prop = RNA_def_property(srna, "use_filter_object_armature", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_ARMATURE);
+ RNA_def_property_ui_text(prop, "Show Armatures", "Show armature objects");
+ RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_ARMATURE, 0);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
+ prop = RNA_def_property(srna, "use_filter_object_empty", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_EMPTY);
+ RNA_def_property_ui_text(prop, "Show Empties", "Show empty objects");
+ RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_EMPTY, 0);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
+ prop = RNA_def_property(srna, "use_filter_object_lamp", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_LAMP);
+ RNA_def_property_ui_text(prop, "Show Lamps", "Show lamps objects");
+ RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_LAMP, 0);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
+ prop = RNA_def_property(srna, "use_filter_object_camera", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_CAMERA);
+ RNA_def_property_ui_text(prop, "Show Cameras", "Show camera objects");
+ RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_CAMERA, 0);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
+
+ prop = RNA_def_property(srna, "use_filter_object_others", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_OTHERS);
+ RNA_def_property_ui_text(prop, "Show Other Objects", "Show curves, lattices, light probes, fonts, ...");
+ RNA_def_property_ui_icon(prop, ICON_ZOOMIN, 0);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL);
}
static void rna_def_space_view3d(BlenderRNA *brna)