From 03fc491048f9efef67033a91d5a37ee0d9d7ec79 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 9 May 2018 13:40:34 +0200 Subject: Outliner: move filter options to popover. --- .../editors/space_outliner/outliner_collections.c | 5 +-- .../blender/editors/space_outliner/outliner_edit.c | 3 +- .../blender/editors/space_outliner/outliner_tree.c | 43 +++++++++------------- 3 files changed, 19 insertions(+), 32 deletions(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c index fd2b463f91b..1cfe5b16fe1 100644 --- a/source/blender/editors/space_outliner/outliner_collections.c +++ b/source/blender/editors/space_outliner/outliner_collections.c @@ -95,10 +95,7 @@ static int outliner_objects_collection_poll(bContext *C) } /* Groups don't support filtering. */ - if ((so->outlinevis != SO_GROUPS) && - ((so->filter & (SO_FILTER_ENABLE | SO_FILTER_NO_COLLECTION)) == - (SO_FILTER_ENABLE | SO_FILTER_NO_COLLECTION))) - { + if ((so->outlinevis != SO_GROUPS) && (so->filter & SO_FILTER_NO_COLLECTION)) { return 0; } diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 2447a7e4a60..9207ee5ae15 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -2089,8 +2089,7 @@ static int outliner_parenting_poll(bContext *C) } if (soops->outlinevis == SO_COLLECTIONS) { - return ((soops->filter & SO_FILTER_ENABLE) && - (soops->filter & SO_FILTER_NO_COLLECTION)); + return (soops->filter & SO_FILTER_NO_COLLECTION); } } diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 2a5151a16ad..d1195621138 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -1833,9 +1833,7 @@ static void outliner_store_scrolling_position(SpaceOops *soops, ARegion *ar, Out static int outliner_exclude_filter_get(SpaceOops *soops) { - int exclude_filter = soops->filter & ~(SO_FILTER_OB_STATE_VISIBLE | - SO_FILTER_OB_STATE_SELECTED | - SO_FILTER_OB_STATE_ACTIVE); + int exclude_filter = soops->filter & ~SO_FILTER_OB_STATE; if (soops->filter & SO_FILTER_SEARCH) { if (soops->search_string[0] == 0) { @@ -1848,26 +1846,19 @@ static int outliner_exclude_filter_get(SpaceOops *soops) return (exclude_filter & SO_FILTER_SEARCH); } - if ((exclude_filter & SO_FILTER_NO_OB_ALL) == 0) { - exclude_filter &= ~SO_FILTER_OB_TYPE; - } - - if (exclude_filter & SO_FILTER_OB_STATE) { - switch (soops->filter_state) { - case SO_FILTER_OB_VISIBLE: - exclude_filter |= SO_FILTER_OB_STATE_VISIBLE; - break; - case SO_FILTER_OB_SELECTED: - exclude_filter |= SO_FILTER_OB_STATE_SELECTED; - break; - case SO_FILTER_OB_ACTIVE: - exclude_filter |= SO_FILTER_OB_STATE_ACTIVE; - break; - } - } - - if ((exclude_filter & SO_FILTER_ANY) == 0) { - exclude_filter &= ~(SO_FILTER_OB_STATE); + switch (soops->filter_state) { + case SO_FILTER_OB_NONE: + exclude_filter |= SO_FILTER_OB_TYPE; + break; + case SO_FILTER_OB_VISIBLE: + exclude_filter |= SO_FILTER_OB_STATE_VISIBLE; + break; + case SO_FILTER_OB_SELECTED: + exclude_filter |= SO_FILTER_OB_STATE_SELECTED; + break; + case SO_FILTER_OB_ACTIVE: + exclude_filter |= SO_FILTER_OB_STATE_ACTIVE; + break; } return exclude_filter; @@ -1875,13 +1866,13 @@ static int outliner_exclude_filter_get(SpaceOops *soops) static bool outliner_element_visible_get(ViewLayer *view_layer, TreeElement *te, const int exclude_filter) { - if ((exclude_filter & SO_FILTER_ENABLE) == 0) { + if ((exclude_filter & SO_FILTER_ANY) == 0) { return true; } TreeStoreElem *tselem = TREESTORE(te); if ((tselem->type == 0) && (te->idcode == ID_OB)) { - if ((exclude_filter & SO_FILTER_NO_OBJECT)) { + if ((exclude_filter & SO_FILTER_OB_TYPE) == SO_FILTER_OB_TYPE) { return false; } @@ -2202,7 +2193,7 @@ void outliner_build_tree(Main *mainvar, Scene *scene, ViewLayer *view_layer, Spa tenlay->directdata = view_layer; TREESTORE(tenlay)->flag &= ~TSE_CLOSED; - if ((soops->filter & SO_FILTER_ENABLE) && (soops->filter & SO_FILTER_NO_COLLECTION)) { + if (soops->filter & SO_FILTER_NO_COLLECTION) { for (Base *base = view_layer->object_bases.first; base; base = base->next) { TreeElement *te_object = outliner_add_element(soops, &tenlay->subtree, base->object, NULL, 0, 0); te_object->directdata = base; -- cgit v1.2.3