diff --git a/scripts/startup/bl_ui/properties_data_grease_pencil.py b/scripts/startup/bl_ui/properties_data_grease_pencil.py index 2605a0bdcbb..16c46be62d8 100644 --- a/scripts/startup/bl_ui/properties_data_grease_pencil.py +++ b/scripts/startup/bl_ui/properties_data_grease_pencil.py @@ -51,6 +51,10 @@ class GREASE_PENCIL_MT_grease_pencil_add_layer_extra(Menu): layout.operator("grease_pencil.layer_group_add", text="Add Group") + layout.separator() + layout.operator("grease_pencil.layer_reveal", icon='RESTRICT_VIEW_OFF', text="Show All") + layout.operator("grease_pencil.layer_hide", icon='RESTRICT_VIEW_ON', text="Hide Others").unselected = True + class DATA_PT_grease_pencil_layers(DataButtonsPanel, Panel): bl_label = "Layers" diff --git a/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc b/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc index 658b50e04ad..954b23aec07 100644 --- a/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc +++ b/source/blender/editors/grease_pencil/intern/grease_pencil_layers.cc @@ -307,6 +307,7 @@ static int grease_pencil_layer_hide_exec(bContext *C, wmOperator *op) /* notifiers */ DEG_id_tag_update(&grease_pencil.id, ID_RECALC_GEOMETRY); WM_event_add_notifier(C, NC_GEOM | ND_DATA, &grease_pencil); + WM_event_add_notifier(C, NC_GPENCIL | NA_EDITED, nullptr); return OPERATOR_FINISHED; } @@ -349,6 +350,7 @@ static int grease_pencil_layer_reveal_exec(bContext *C, wmOperator * /*op*/) /* notifiers */ DEG_id_tag_update(&grease_pencil.id, ID_RECALC_GEOMETRY); WM_event_add_notifier(C, NC_GEOM | ND_DATA, &grease_pencil); + WM_event_add_notifier(C, NC_GPENCIL | NA_EDITED, nullptr); return OPERATOR_FINISHED; }