Fix: Outliner: Grease Pencil object filter
The filter for grease pencil objects wasn't showing up. The code was still checking for the legacy type. Now, we're checking for the right object type and are also looking at the `bpy.data.grease_pencils_v3` list to make the checkbox show up in the UI.
This commit is contained in:
@@ -492,7 +492,7 @@ class OUTLINER_PT_filter(Panel):
|
||||
row = sub.row()
|
||||
row.label(icon='CAMERA_DATA')
|
||||
row.prop(space, "use_filter_object_camera", text="Cameras")
|
||||
if bpy.data.grease_pencils:
|
||||
if bpy.data.grease_pencils_v3:
|
||||
row = sub.row()
|
||||
row.label(icon='STROKE')
|
||||
row.prop(space, "use_filter_object_grease_pencil", text="Grease Pencil")
|
||||
|
||||
@@ -907,8 +907,8 @@ static bool outliner_element_visible_get(const Scene *scene,
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case OB_GPENCIL_LEGACY:
|
||||
if (exclude_filter & SO_FILTER_NO_OB_GPENCIL_LEGACY) {
|
||||
case OB_GREASE_PENCIL:
|
||||
if (exclude_filter & SO_FILTER_NO_OB_GREASE_PENCIL) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -368,12 +368,12 @@ typedef enum eSpaceOutliner_Filter {
|
||||
|
||||
SO_FILTER_ID_TYPE = (1 << 19),
|
||||
|
||||
SO_FILTER_NO_OB_GPENCIL_LEGACY = (1 << 20),
|
||||
SO_FILTER_NO_OB_GREASE_PENCIL = (1 << 20),
|
||||
} eSpaceOutliner_Filter;
|
||||
|
||||
#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_GPENCIL_LEGACY | \
|
||||
SO_FILTER_NO_OB_LAMP | SO_FILTER_NO_OB_CAMERA | SO_FILTER_NO_OB_GREASE_PENCIL | \
|
||||
SO_FILTER_NO_OB_OTHERS)
|
||||
|
||||
#define SO_FILTER_OB_STATE \
|
||||
|
||||
@@ -4038,7 +4038,7 @@ static void rna_def_space_outliner(BlenderRNA *brna)
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "use_filter_object_grease_pencil", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, nullptr, "filter", SO_FILTER_NO_OB_GPENCIL_LEGACY);
|
||||
RNA_def_property_boolean_negative_sdna(prop, nullptr, "filter", SO_FILTER_NO_OB_GREASE_PENCIL);
|
||||
RNA_def_property_ui_text(prop, "Show Grease Pencil", "Show grease pencil objects");
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, nullptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user