[Bf-blender-cvs] [0145daa09bb] blender2.8: Outliner: Make search always work

Dalai Felinto noreply at git.blender.org
Mon Jun 25 12:15:16 CEST 2018


Commit: 0145daa09bba74df474f0626fac8372c0a7e2b90
Author: Dalai Felinto
Date:   Mon Jun 25 12:14:38 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB0145daa09bba74df474f0626fac8372c0a7e2b90

Outliner: Make search always work

This was a flag in early 2.8 to allow users to hide the entire search prop.
Now since we want it fully expanded at all times, it makes no more sense.

===================================================================

M	release/scripts/startup/bl_ui/space_outliner.py
M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_intern.h
M	source/blender/editors/space_outliner/outliner_tree.c
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesrna/intern/rna_space.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py
index e8ae36aa3fc..df48d17274d 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -43,10 +43,7 @@ class OUTLINER_HT_header(Header):
         layout.separator_spacer()
 
         row = layout.row(align=True)
-        row.prop(space, "use_filter_search", text="")
-        sub = row.row(align=True)
-        sub.prop(space, "filter_text", text="")
-        sub.enabled = space.use_filter_search
+        row.prop(space, "filter_text", icon='VIEWZOOM', text="")
 
         layout.separator_spacer()
 
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 64a9c901175..5d2be638964 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1960,7 +1960,6 @@ static void outliner_draw_highlights_recursive(
 	const bool is_searching = (
 	        SEARCHING_OUTLINER(soops) ||
 	        (soops->outlinevis == SO_DATA_API &&
-	         (soops->filter & SO_FILTER_SEARCH) &&
 	         soops->search_string[0] != 0));
 
 	for (TreeElement *te = lb->first; te; te = te->next) {
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index 1f8320f73a0..0ab22208841 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -182,7 +182,7 @@ typedef enum {
  * - not searching into RNA items helps but isn't the complete solution
  */
 
-#define SEARCHING_OUTLINER(sov)   ((sov->search_flags & SO_SEARCH_RECURSIVE) && (sov->filter & SO_FILTER_SEARCH))
+#define SEARCHING_OUTLINER(sov)   (sov->search_flags & SO_SEARCH_RECURSIVE)
 
 /* is the currrent element open? if so we also show children */
 #define TSELEM_OPEN(telm, sv)    ( (telm->flag & TSE_CLOSED) == 0 || (SEARCHING_OUTLINER(sv) && (telm->flag & TSE_CHILDSEARCH)) )
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 01df653c86d..63312561678 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -1892,10 +1892,11 @@ static int outliner_exclude_filter_get(SpaceOops *soops)
 {
 	int exclude_filter = soops->filter & ~SO_FILTER_OB_STATE;
 
-	if (soops->filter & SO_FILTER_SEARCH) {
-		if (soops->search_string[0] == 0) {
-			exclude_filter &= ~SO_FILTER_SEARCH;
-		}
+	if (soops->search_string[0] != 0) {
+		exclude_filter |= SO_FILTER_SEARCH;
+	}
+	else {
+		exclude_filter &= ~SO_FILTER_SEARCH;
 	}
 
 	/* Let's have this for the collection options at first. */
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 4f07a30ed70..bbfbf660774 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -274,7 +274,7 @@ typedef enum eSpaceOutliner_Flag {
 
 /* SpaceOops.filter */
 typedef enum eSpaceOutliner_Filter {
-	SO_FILTER_SEARCH           = (1 << 0),
+	SO_FILTER_SEARCH           = (1 << 0), /* Run-time flag. */
 	/* SO_FILTER_ENABLE           = (1 << 1), */ /* Deprecated */
 	SO_FILTER_NO_OBJECT        = (1 << 2),
 	SO_FILTER_NO_OB_CONTENT    = (1 << 3), /* Not only mesh, but modifiers, constraints, ... */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 8dab3551efa..68af5795d49 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2295,12 +2295,6 @@ static void rna_def_space_outliner(BlenderRNA *brna)
 	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_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");



More information about the Bf-blender-cvs mailing list