[Bf-blender-cvs] [d2493bdd776] soc-2019-outliner: Outliner Visibility: Add Invisible filter

Nathan Craddock noreply at git.blender.org
Thu Jun 13 23:24:01 CEST 2019


Commit: d2493bdd776ae18140cf8769e59229ea772bcb85
Author: Nathan Craddock
Date:   Thu Jun 13 15:20:01 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rBd2493bdd776ae18140cf8769e59229ea772bcb85

Outliner Visibility: Add Invisible filter

This adds an object invisible filter to the outliner to only show hidden
or disabled objects in the outliner. In large scenes, it is often
difficult to locate hidden objects in the outliner to show them again.
This invisible filter makes it easier.

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

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/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 6c2aa992ee9..f4e55c3e6b7 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -2008,6 +2008,8 @@ static int outliner_exclude_filter_get(SpaceOutliner *soops)
     case SO_FILTER_OB_VISIBLE:
       exclude_filter |= SO_FILTER_OB_STATE_VISIBLE;
       break;
+    case SO_FILTER_OB_INVISIBLE:
+      exclude_filter |= SO_FILTER_OB_STATE_INVISIBLE;
     case SO_FILTER_OB_SELECTED:
       exclude_filter |= SO_FILTER_OB_STATE_SELECTED;
       break;
@@ -2086,6 +2088,11 @@ static bool outliner_element_visible_get(ViewLayer *view_layer,
           return false;
         }
       }
+      else if (exclude_filter & SO_FILTER_OB_STATE_INVISIBLE) {
+        if ((base->flag & BASE_VISIBLE) != 0) {
+          return false;
+        }
+      }
       else if (exclude_filter & SO_FILTER_OB_STATE_SELECTED) {
         if ((base->flag & BASE_SELECTED) == 0) {
           return false;
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 69c8d6b9cda..81da40d44b6 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -283,13 +283,14 @@ typedef enum eSpaceOutliner_Filter {
   SO_FILTER_NO_OB_CAMERA = (1 << 10),
   SO_FILTER_NO_OB_OTHERS = (1 << 11),
 
-  SO_FILTER_UNUSED_12 = (1 << 12),         /* cleared */
-  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),
-
-  SO_FILTER_ID_TYPE = (1 << 17),
+  SO_FILTER_UNUSED_12 = (1 << 12),          /* cleared */
+  SO_FILTER_OB_STATE_VISIBLE = (1 << 13),   /* Not set via DNA. */
+  SO_FILTER_OB_STATE_INVISIBLE = (1 << 14), /* Not set via DNA. */
+  SO_FILTER_OB_STATE_SELECTED = (1 << 15),  /* Not set via DNA. */
+  SO_FILTER_OB_STATE_ACTIVE = (1 << 16),    /* Not set via DNA. */
+  SO_FILTER_NO_COLLECTION = (1 << 17),
+
+  SO_FILTER_ID_TYPE = (1 << 18),
 } eSpaceOutliner_Filter;
 
 #define SO_FILTER_OB_TYPE \
@@ -297,7 +298,8 @@ typedef enum eSpaceOutliner_Filter {
    SO_FILTER_NO_OB_LAMP | SO_FILTER_NO_OB_CAMERA | SO_FILTER_NO_OB_OTHERS)
 
 #define SO_FILTER_OB_STATE \
-  (SO_FILTER_OB_STATE_VISIBLE | SO_FILTER_OB_STATE_SELECTED | SO_FILTER_OB_STATE_ACTIVE)
+  (SO_FILTER_OB_STATE_VISIBLE | SO_FILTER_OB_STATE_INVISIBLE | 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 | \
@@ -307,8 +309,9 @@ typedef enum eSpaceOutliner_Filter {
 typedef enum eSpaceOutliner_StateFilter {
   SO_FILTER_OB_ALL = 0,
   SO_FILTER_OB_VISIBLE = 1,
-  SO_FILTER_OB_SELECTED = 2,
-  SO_FILTER_OB_ACTIVE = 3,
+  SO_FILTER_OB_INVISIBLE = 2,
+  SO_FILTER_OB_SELECTED = 3,
+  SO_FILTER_OB_ACTIVE = 4,
 } eSpaceOutliner_StateFilter;
 
 /* SpaceOutliner.show_restrict_flags */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 72803a7090f..b485143d808 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2790,6 +2790,7 @@ static void rna_def_space_outliner(BlenderRNA *brna)
   static const EnumPropertyItem filter_state_items[] = {
       {SO_FILTER_OB_ALL, "ALL", 0, "All", "Show all objects in the view layer"},
       {SO_FILTER_OB_VISIBLE, "VISIBLE", 0, "Visible", "Show visible objects"},
+      {SO_FILTER_OB_INVISIBLE, "INVISIBLE", 0, "Invisible", "Show invisible objects"},
       {SO_FILTER_OB_SELECTED, "SELECTED", 0, "Selected", "Show selected objects"},
       {SO_FILTER_OB_ACTIVE, "ACTIVE", 0, "Active", "Show only the active object"},
       {0, NULL, 0, NULL, NULL},



More information about the Bf-blender-cvs mailing list