GPencil: Animation menu updates

Animation menu updates for Edit Mode and Draw Mode (header and context menu):

- Rename menu items for a better understanding of what the operators really do.
- Change shortcuts (legacy from the old Grease pencil)

{F7708018}

Reviewers: antoniov, pepeland, billreynish

Tags: #bf_blender, #grease_pencil

Differential Revision: https://developer.blender.org/D5617
This commit is contained in:
Matias Mendiola 2019-08-28 20:31:01 +02:00 committed by Antonio Vazquez
parent 34ed58dcaf
commit a7ac8a22f8
Notes: blender-bot 2023-02-14 10:54:29 +01:00
Referenced by issue #88665, Impossible to weight paint certain vertices
Referenced by issue #70109, Crash with the Data Transfer Modifier (with any 'Edge Data' option)
Referenced by issue #69278, "Make Single User" not working properly, copying / pasting always linking object
Referenced by issue #69114, Selection Tool selects occluded objects
3 changed files with 35 additions and 26 deletions

View File

@ -2948,13 +2948,6 @@ def km_grease_pencil(_params):
# Erase
("gpencil.annotate", {"type": 'RIGHTMOUSE', "value": 'PRESS', "key_modifier": 'D'},
{"properties": [("mode", 'ERASER'), ("wait_for_input", False)]}),
# Add blank frame (B because it's easy to reach from D).
("gpencil.blank_frame_add", {"type": 'B', "value": 'PRESS', "key_modifier": 'D'}, None),
# Delete active frame - for easier video tutorials/review sessions.
# This works even when not in edit mode.
("gpencil.active_frames_delete_all", {"type": 'X', "value": 'PRESS', "key_modifier": 'D'}, None),
("gpencil.active_frames_delete_all", {"type": 'DEL', "value": 'PRESS', "key_modifier": 'D'}, None),
])
return keymap
@ -3037,6 +3030,8 @@ def km_grease_pencil_stroke_edit_mode(params):
op_menu("VIEW3D_MT_edit_gpencil_delete", {"type": 'DEL', "value": 'PRESS'}),
("gpencil.dissolve", {"type": 'X', "value": 'PRESS', "ctrl": True}, None),
("gpencil.dissolve", {"type": 'DEL', "value": 'PRESS', "ctrl": True}, None),
# Animation menu
("gpencil.blank_frame_add", {"type": 'I', "value": 'PRESS', "shift": True}, None),
("gpencil.active_frames_delete_all", {"type": 'X', "value": 'PRESS', "shift": True}, None),
("gpencil.active_frames_delete_all", {"type": 'DEL', "value": 'PRESS', "shift": True}, None),
# Context menu
@ -3125,6 +3120,19 @@ def km_grease_pencil_stroke_paint_mode(params):
op_panel("VIEW3D_PT_gpencil_draw_context_menu", params.context_menu_event),
# Draw delete menu
op_menu("GPENCIL_MT_gpencil_draw_delete", {"type": 'X', "value": 'PRESS'}),
# Animation menu
("gpencil.blank_frame_add", {"type": 'I', "value": 'PRESS', "shift": True}, None),
("gpencil.active_frames_delete_all", {"type": 'X', "value": 'PRESS', "shift": True}, None),
("gpencil.active_frames_delete_all", {"type": 'DEL', "value": 'PRESS', "shift": True}, None),
# Interpolation
("gpencil.interpolate", {"type": 'E', "value": 'PRESS', "ctrl": True, "alt": True}, None),
("gpencil.interpolate_sequence", {"type": 'E', "value": 'PRESS', "shift": True, "ctrl": True}, None),
# Show/hide
("gpencil.reveal", {"type": 'H', "value": 'PRESS', "alt": True}, None),
("gpencil.hide", {"type": 'H', "value": 'PRESS'},
{"properties": [("unselected", False)]}),
("gpencil.hide", {"type": 'H', "value": 'PRESS', "shift": True},
{"properties": [("unselected", True)]}),
])
return keymap

View File

@ -592,14 +592,15 @@ class GPENCIL_MT_snap(Menu):
class GPENCIL_MT_gpencil_draw_delete(Menu):
bl_label = "GPencil Draw Delete"
bl_label = "Delete"
def draw(self, _context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("gpencil.active_frames_delete_all", text="Delete Frame")
layout.operator("gpencil.delete", text="Delete Active Keyframe (Active Layer)").type = 'FRAME'
layout.operator("gpencil.active_frames_delete_all", text="Delete Active Keyframes (All Layers)")
class GPENCIL_MT_cleanup(Menu):

View File

@ -3933,7 +3933,9 @@ class VIEW3D_MT_edit_gpencil_delete(Menu):
layout.separator()
layout.operator("gpencil.active_frames_delete_all")
layout.operator("gpencil.delete", text="Delete Active Keyframe (Active Layer)").type = 'FRAME'
layout.operator("gpencil.active_frames_delete_all", text="Delete Active Keyframes (All Layers)")
# Edit Curve
# draw_curve is used by VIEW3D_MT_edit_curve and VIEW3D_MT_edit_surface
@ -4564,17 +4566,18 @@ class VIEW3D_MT_gpencil_animation(Menu):
def draw(self, _context):
layout = self.layout
layout.operator("gpencil.blank_frame_add")
layout.operator("gpencil.blank_frame_add", text="Insert Blank Keyframe (Active Layer)")
layout.operator("gpencil.blank_frame_add", text="Insert Blank Keyframe (All Layers)").all_layers = True
layout.separator()
layout.operator("gpencil.frame_duplicate", text="Duplicate Active Frame")
layout.operator("gpencil.frame_duplicate", text="Duplicate All Layers").mode = 'ALL'
layout.operator("gpencil.frame_duplicate", text="Duplicate Active Keyframe (Active Layer)")
layout.operator("gpencil.frame_duplicate", text="Duplicate Active Keyframe (All Layers)").mode = 'ALL'
layout.separator()
layout.operator("gpencil.delete", text="Delete Active Frame").type = 'FRAME'
layout.operator("gpencil.active_frames_delete_all", text="Delete All Active Frames")
layout.operator("gpencil.delete", text="Delete Active Keyframe (Active Layer)").type = 'FRAME'
layout.operator("gpencil.active_frames_delete_all", text="Delete Active Keyframes (All Layers)")
class VIEW3D_MT_edit_gpencil_transform(Menu):
@ -4595,9 +4598,6 @@ class VIEW3D_MT_edit_gpencil_transform(Menu):
layout.operator("transform.transform", text="Shrink Fatten").mode = 'GPENCIL_SHRINKFATTEN'
layout.operator("gpencil.interpolate", text="Interpolate")
layout.operator("gpencil.interpolate_sequence", text="Sequence")
class VIEW3D_MT_edit_gpencil_showhide(Menu):
bl_label = "Show/hide"
@ -6421,13 +6421,13 @@ class VIEW3D_PT_gpencil_sculpt_context_menu(Panel):
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("gpencil.blank_frame_add", text="Insert Blank", icon='ADD')
layout.operator("gpencil.frame_duplicate", text="Duplicate Active", icon='DUPLICATE')
layout.operator("gpencil.frame_duplicate", text="Duplicate for All Layers", icon='DUPLICATE').mode = 'ALL'
layout.operator("gpencil.frame_duplicate", text="Duplicate Active Layer", icon='DUPLICATE')
layout.operator("gpencil.frame_duplicate", text="Duplicate All Layers", icon='DUPLICATE').mode = 'ALL'
layout.separator()
layout.operator("gpencil.delete", text="Delete Active", icon='REMOVE').type = 'FRAME'
layout.operator("gpencil.active_frames_delete_all", text="Delete All Active Layers", icon='REMOVE')
layout.operator("gpencil.delete", text="Delete Active Layer", icon='REMOVE').type = 'FRAME'
layout.operator("gpencil.active_frames_delete_all", text="Delete All Layers", icon='REMOVE')
class VIEW3D_PT_gpencil_draw_context_menu(Panel):
@ -6454,13 +6454,13 @@ class VIEW3D_PT_gpencil_draw_context_menu(Panel):
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("gpencil.blank_frame_add", text="Insert Blank", icon='ADD')
layout.operator("gpencil.frame_duplicate", text="Duplicate Active", icon='DUPLICATE')
layout.operator("gpencil.frame_duplicate", text="Duplicate for All Layers", icon='DUPLICATE').mode = 'ALL'
layout.operator("gpencil.frame_duplicate", text="Duplicate Active Layer", icon='DUPLICATE')
layout.operator("gpencil.frame_duplicate", text="Duplicate All Layers", icon='DUPLICATE').mode = 'ALL'
layout.separator()
layout.operator("gpencil.delete", text="Delete Active", icon='REMOVE').type = 'FRAME'
layout.operator("gpencil.active_frames_delete_all", text="Delete All Active Layers", icon='REMOVE')
layout.operator("gpencil.delete", text="Delete Active Layer", icon='REMOVE').type = 'FRAME'
layout.operator("gpencil.active_frames_delete_all", text="Delete All Layers", icon='REMOVE')
class VIEW3D_PT_paint_vertex_context_menu(Panel):