[Bf-blender-cvs] [a0cd2dbcce0] soc-2020-outliner: Outliner: Add new row children filter

Nathan Craddock noreply at git.blender.org
Sat Aug 15 00:46:37 CEST 2020


Commit: a0cd2dbcce01c40b9ae7508418309e0ccfabeecf
Author: Nathan Craddock
Date:   Fri Aug 14 16:24:31 2020 -0600
Branches: soc-2020-outliner
https://developer.blender.org/rBa0cd2dbcce01c40b9ae7508418309e0ccfabeecf

Outliner: Add new row children filter

Add a new filter to prevent the drawing of row icons.

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

M	release/scripts/startup/bl_ui/space_outliner.py
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/editors/space_outliner/outliner_draw.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 d30a402892f..0826a65ec62 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -398,6 +398,9 @@ class OUTLINER_PT_filter(Panel):
         row = sub.row()
         row.label(icon='BLANK1')
         row.prop(space, "use_filter_children", text="Object Children")
+        row = sub.row()
+        row.label(icon='BLANK1')
+        row.prop(space, "use_filter_row_children", text="Row Children")
 
         if bpy.data.meshes:
             row = sub.row()
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 0d8f2eac99e..5107b530b08 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3413,7 +3413,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
             }
             case SPACE_OUTLINER: {
               SpaceOutliner *space_outliner = (SpaceOutliner *)sl;
-              space_outliner->filter &= ~(SO_FILTER_UNUSED_1 | SO_FILTER_UNUSED_5 |
+              space_outliner->filter &= ~(SO_FILTER_UNUSED_1 | SO_FILTER_NO_ROW_CHILDREN |
                                           SO_FILTER_UNUSED_12);
               space_outliner->storeflag &= ~(SO_TREESTORE_UNUSED_1);
               break;
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 0894c20c81d..34679473a98 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -3294,7 +3294,8 @@ static void outliner_draw_tree_element(bContext *C,
     offsx += (int)(UI_UNIT_X + UI_fontstyle_string_width(fstyle, te->name));
 
     /* closed item, we draw the icons, not when it's a scene, or master-server list though */
-    if (!TSELEM_OPEN(tselem, space_outliner)) {
+    if (!TSELEM_OPEN(tselem, space_outliner) &&
+        !(space_outliner->filter & SO_FILTER_NO_ROW_CHILDREN)) {
       if (te->subtree.first) {
         if (tselem->type == 0 && te->idcode == ID_SCE) {
           /* pass */
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 41082ee2c89..9a88a9181f1 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -298,7 +298,7 @@ typedef enum eSpaceOutliner_Filter {
   SO_FILTER_NO_OB_CONTENT = (1 << 3), /* Not only mesh, but modifiers, constraints, ... */
   SO_FILTER_NO_CHILDREN = (1 << 4),
 
-  SO_FILTER_UNUSED_5 = (1 << 5), /* cleared */
+  SO_FILTER_NO_ROW_CHILDREN = (1 << 5),
   SO_FILTER_NO_OB_MESH = (1 << 6),
   SO_FILTER_NO_OB_ARMATURE = (1 << 7),
   SO_FILTER_NO_OB_EMPTY = (1 << 8),
@@ -325,8 +325,8 @@ typedef enum eSpaceOutliner_Filter {
    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 | \
-   SO_FILTER_NO_COLLECTION)
+  (SO_FILTER_NO_OB_CONTENT | SO_FILTER_NO_CHILDREN | SO_FILTER_NO_ROW_CHILDREN | \
+   SO_FILTER_OB_TYPE | SO_FILTER_OB_STATE | SO_FILTER_NO_COLLECTION)
 
 /* SpaceOutliner.filter_state */
 typedef enum eSpaceOutliner_StateFilter {
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index b7e5a0d6317..f321b604865 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -3109,6 +3109,11 @@ static void rna_def_space_outliner(BlenderRNA *brna)
   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_row_children", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_ROW_CHILDREN);
+  RNA_def_property_ui_text(prop, "Show Row Children", "Show children on collapsed rows");
+  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, "Show Collections", "Show collections");



More information about the Bf-blender-cvs mailing list