Outliner: invisible object filter
Adds an invisible object filter in the outliner to show hidden objects. This is useful to quickly locate hidden items in a large outliner tree and easily toggle visibilty back on. Invisible refers to an object being hidden, or viewport visibility restricted.
This commit is contained in:
@@ -2008,6 +2008,9 @@ static int outliner_exclude_filter_get(SpaceOutliner *soops)
|
|||||||
case SO_FILTER_OB_VISIBLE:
|
case SO_FILTER_OB_VISIBLE:
|
||||||
exclude_filter |= SO_FILTER_OB_STATE_VISIBLE;
|
exclude_filter |= SO_FILTER_OB_STATE_VISIBLE;
|
||||||
break;
|
break;
|
||||||
|
case SO_FILTER_OB_INVISIBLE:
|
||||||
|
exclude_filter |= SO_FILTER_OB_STATE_INVISIBLE;
|
||||||
|
break;
|
||||||
case SO_FILTER_OB_SELECTED:
|
case SO_FILTER_OB_SELECTED:
|
||||||
exclude_filter |= SO_FILTER_OB_STATE_SELECTED;
|
exclude_filter |= SO_FILTER_OB_STATE_SELECTED;
|
||||||
break;
|
break;
|
||||||
@@ -2086,6 +2089,11 @@ static bool outliner_element_visible_get(ViewLayer *view_layer,
|
|||||||
return false;
|
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) {
|
else if (exclude_filter & SO_FILTER_OB_STATE_SELECTED) {
|
||||||
if ((base->flag & BASE_SELECTED) == 0) {
|
if ((base->flag & BASE_SELECTED) == 0) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -287,13 +287,14 @@ typedef enum eSpaceOutliner_Filter {
|
|||||||
SO_FILTER_NO_OB_CAMERA = (1 << 10),
|
SO_FILTER_NO_OB_CAMERA = (1 << 10),
|
||||||
SO_FILTER_NO_OB_OTHERS = (1 << 11),
|
SO_FILTER_NO_OB_OTHERS = (1 << 11),
|
||||||
|
|
||||||
SO_FILTER_UNUSED_12 = (1 << 12), /* cleared */
|
SO_FILTER_UNUSED_12 = (1 << 12), /* cleared */
|
||||||
SO_FILTER_OB_STATE_VISIBLE = (1 << 13), /* Not set via DNA. */
|
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_INVISIBLE = (1 << 14), /* Not set via DNA. */
|
||||||
SO_FILTER_OB_STATE_ACTIVE = (1 << 15), /* Not set via DNA. */
|
SO_FILTER_OB_STATE_SELECTED = (1 << 15), /* Not set via DNA. */
|
||||||
SO_FILTER_NO_COLLECTION = (1 << 16),
|
SO_FILTER_OB_STATE_ACTIVE = (1 << 16), /* Not set via DNA. */
|
||||||
|
SO_FILTER_NO_COLLECTION = (1 << 17),
|
||||||
|
|
||||||
SO_FILTER_ID_TYPE = (1 << 17),
|
SO_FILTER_ID_TYPE = (1 << 18),
|
||||||
} eSpaceOutliner_Filter;
|
} eSpaceOutliner_Filter;
|
||||||
|
|
||||||
#define SO_FILTER_OB_TYPE \
|
#define SO_FILTER_OB_TYPE \
|
||||||
@@ -301,7 +302,8 @@ typedef enum eSpaceOutliner_Filter {
|
|||||||
SO_FILTER_NO_OB_LAMP | SO_FILTER_NO_OB_CAMERA | SO_FILTER_NO_OB_OTHERS)
|
SO_FILTER_NO_OB_LAMP | SO_FILTER_NO_OB_CAMERA | SO_FILTER_NO_OB_OTHERS)
|
||||||
|
|
||||||
#define SO_FILTER_OB_STATE \
|
#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 \
|
#define SO_FILTER_ANY \
|
||||||
(SO_FILTER_NO_OB_CONTENT | SO_FILTER_NO_CHILDREN | SO_FILTER_OB_TYPE | SO_FILTER_OB_STATE | \
|
(SO_FILTER_NO_OB_CONTENT | SO_FILTER_NO_CHILDREN | SO_FILTER_OB_TYPE | SO_FILTER_OB_STATE | \
|
||||||
@@ -311,8 +313,9 @@ typedef enum eSpaceOutliner_Filter {
|
|||||||
typedef enum eSpaceOutliner_StateFilter {
|
typedef enum eSpaceOutliner_StateFilter {
|
||||||
SO_FILTER_OB_ALL = 0,
|
SO_FILTER_OB_ALL = 0,
|
||||||
SO_FILTER_OB_VISIBLE = 1,
|
SO_FILTER_OB_VISIBLE = 1,
|
||||||
SO_FILTER_OB_SELECTED = 2,
|
SO_FILTER_OB_INVISIBLE = 2,
|
||||||
SO_FILTER_OB_ACTIVE = 3,
|
SO_FILTER_OB_SELECTED = 3,
|
||||||
|
SO_FILTER_OB_ACTIVE = 4,
|
||||||
} eSpaceOutliner_StateFilter;
|
} eSpaceOutliner_StateFilter;
|
||||||
|
|
||||||
/* SpaceOutliner.show_restrict_flags */
|
/* SpaceOutliner.show_restrict_flags */
|
||||||
|
|||||||
@@ -2777,6 +2777,7 @@ static void rna_def_space_outliner(BlenderRNA *brna)
|
|||||||
static const EnumPropertyItem filter_state_items[] = {
|
static const EnumPropertyItem filter_state_items[] = {
|
||||||
{SO_FILTER_OB_ALL, "ALL", 0, "All", "Show all objects in the view layer"},
|
{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_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_SELECTED, "SELECTED", 0, "Selected", "Show selected objects"},
|
||||||
{SO_FILTER_OB_ACTIVE, "ACTIVE", 0, "Active", "Show only the active object"},
|
{SO_FILTER_OB_ACTIVE, "ACTIVE", 0, "Active", "Show only the active object"},
|
||||||
{0, NULL, 0, NULL, NULL},
|
{0, NULL, 0, NULL, NULL},
|
||||||
|
|||||||
Reference in New Issue
Block a user