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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-05-09 14:40:34 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-05-09 16:17:17 +0300
commit03fc491048f9efef67033a91d5a37ee0d9d7ec79 (patch)
tree6f628507b9f6bdfcda157fd6c414c8bcdb7762bc /source/blender
parentd3b80c4734d1cc5ece8d3eca5f95068eaec85e81 (diff)
Outliner: move filter options to popover.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_outliner/outliner_collections.c5
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c3
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c43
-rw-r--r--source/blender/makesdna/DNA_space_types.h35
-rw-r--r--source/blender/makesrna/intern/rna_space.c50
5 files changed, 48 insertions, 88 deletions
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;
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 795cd0ee974..292120d1f6e 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -279,12 +279,12 @@ typedef enum eSpaceOutliner_Flag {
/* SpaceOops->filter */
typedef enum eSpaceOutliner_Filter {
SO_FILTER_SEARCH = (1 << 0),
- SO_FILTER_ENABLE = (1 << 1),
- SO_FILTER_NO_OBJECT = (1 << 2),
+ /* SO_FILTER_ENABLE = (1 << 1), */ /* Deprecated */
+ /* SO_FILTER_NO_OBJECT = (1 << 2), */ /* Deprecated */
SO_FILTER_NO_OB_CONTENT = (1 << 3), /* Not only mesh, but modifiers, constraints, ... */
SO_FILTER_NO_CHILDREN = (1 << 4),
- SO_FILTER_OB_TYPE = (1 << 5),
+ /* SO_FILTER_OB_TYPE = (1 << 5), */ /* Deprecated */
SO_FILTER_NO_OB_MESH = (1 << 6),
SO_FILTER_NO_OB_ARMATURE = (1 << 7),
SO_FILTER_NO_OB_EMPTY = (1 << 8),
@@ -292,22 +292,25 @@ typedef enum eSpaceOutliner_Filter {
SO_FILTER_NO_OB_CAMERA = (1 << 10),
SO_FILTER_NO_OB_OTHERS = (1 << 11),
- SO_FILTER_OB_STATE = (1 << 12),
+ /* SO_FILTER_OB_STATE = (1 << 12), */ /* Deprecated */
SO_FILTER_OB_STATE_VISIBLE = (1 << 13), /* Not set via DNA. */
SO_FILTER_OB_STATE_SELECTED = (1 << 14), /* Not set via DNA. */
SO_FILTER_OB_STATE_ACTIVE = (1 << 15), /* Not set via DNA. */
SO_FILTER_NO_COLLECTION = (1 << 16),
} eSpaceOutliner_Filter;
-#define SO_FILTER_NO_OB_ALL (SO_FILTER_NO_OB_MESH | \
- SO_FILTER_NO_OB_ARMATURE | \
- SO_FILTER_NO_OB_EMPTY | \
- SO_FILTER_NO_OB_LAMP | \
- SO_FILTER_NO_OB_CAMERA | \
- SO_FILTER_NO_OB_OTHERS)
+#define SO_FILTER_OB_TYPE (SO_FILTER_NO_OB_MESH | \
+ SO_FILTER_NO_OB_ARMATURE | \
+ SO_FILTER_NO_OB_EMPTY | \
+ SO_FILTER_NO_OB_LAMP | \
+ SO_FILTER_NO_OB_CAMERA | \
+ SO_FILTER_NO_OB_OTHERS)
-#define SO_FILTER_ANY (SO_FILTER_NO_OBJECT | \
- SO_FILTER_NO_OB_CONTENT | \
+#define SO_FILTER_OB_STATE (SO_FILTER_OB_STATE_VISIBLE | \
+ SO_FILTER_OB_STATE_SELECTED | \
+ SO_FILTER_OB_STATE_ACTIVE)
+
+#define SO_FILTER_ANY (SO_FILTER_NO_OB_CONTENT | \
SO_FILTER_NO_CHILDREN | \
SO_FILTER_OB_TYPE | \
SO_FILTER_OB_STATE | \
@@ -315,9 +318,11 @@ typedef enum eSpaceOutliner_Filter {
/* SpaceOops->filter_state */
typedef enum eSpaceOutliner_StateFilter {
- SO_FILTER_OB_VISIBLE = 0,
- SO_FILTER_OB_SELECTED = 1,
- SO_FILTER_OB_ACTIVE = 2,
+ SO_FILTER_OB_ALL = 0,
+ SO_FILTER_OB_VISIBLE = 1,
+ SO_FILTER_OB_SELECTED = 2,
+ SO_FILTER_OB_ACTIVE = 3,
+ SO_FILTER_OB_NONE = 4,
} eSpaceOutliner_StateFilter;
/* SpaceOops->outlinevis */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 20e69932e47..0626a0be764 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2036,9 +2036,11 @@ static void rna_def_space_outliner(BlenderRNA *brna)
};
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"},
+ {SO_FILTER_OB_NONE, "NONE", 0, "No Objects", "Don't show objects"},
+ {SO_FILTER_OB_ALL, "ALL", 0, "All Objects", "Show visible objects"},
+ {SO_FILTER_OB_VISIBLE, "VISIBLE", 0, "Visible Objects", "Show visible objects"},
+ {SO_FILTER_OB_SELECTED, "SELECTED", 0, "Selected Objects", "Show selected objects"},
+ {SO_FILTER_OB_ACTIVE, "ACTIVE", 0, "Active Object", "Show only the active object"},
{0, NULL, 0, NULL, NULL}
};
@@ -2088,91 +2090,57 @@ static void rna_def_space_outliner(BlenderRNA *brna)
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_ui_text(prop, "Show Object Contents", "Show what is inside the objects elements");
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_ui_text(prop, "Show Object Children", "Show children");
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_ui_text(prop, "Show Collections", "Show collections");
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_ui_text(prop, "Object 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);
}