GPv3: Missing add layer option in menu when list is empty #115785

Merged
Falk David merged 1 commits from PratikPB2123/blender:gpv3-missing-add-layer into main 2023-12-07 10:51:58 +01:00
1 changed files with 3 additions and 2 deletions

View File

@ -281,12 +281,13 @@ class GREASE_PENCIL_MT_layer_active(Menu):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
obd = context.active_object.data
if not obd.layers:
return
nlop = layout.operator("grease_pencil.layer_add", text="New Layer", icon='ADD')
nlop.new_layer_name = "Layer"
if not obd.layers:
return
layout.separator()
for i in range(len(obd.layers) - 1, -1, -1):