GPv3: "Set Active Layer" operator and menu

Resolves #113915 .

Ports the `layer_active` operator to set the active layer from an index.
Adds the menu to set the active layer from a list.

Pull Request: https://projects.blender.org/blender/blender/pulls/115606
This commit is contained in:
Clément Busschaert
2023-11-30 16:10:06 +01:00
committed by Falk David
parent 6023a6a423
commit 671f428ead
4 changed files with 75 additions and 1 deletions
@@ -4575,6 +4575,9 @@ def km_grease_pencil_paint(_params):
{"properties": [("mode", 'INVERT')]}),
("grease_pencil.brush_stroke", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
{"properties": [("mode", 'SMOOTH')]}),
# Active layer
op_menu("GREASE_PENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
])
return keymap
@@ -4623,6 +4626,9 @@ def km_grease_pencil_edit(params):
("grease_pencil.cyclical_set", {"type": 'C', "value": 'PRESS',
"alt": True}, {"properties": [("type", "TOGGLE")]}),
# Active layer
op_menu("GREASE_PENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
# Context menu
*_template_items_context_menu("VIEW3D_MT_greasepencil_edit_context_menu", params.context_menu_event),
])