[Bf-blender-cvs] [f5bafbfedec] greasepencil-object: GPencil: Fix Animation menu

Antonio Vazquez noreply at git.blender.org
Sun Mar 1 19:01:07 CET 2020


Commit: f5bafbfedec8a65707a51e30d7125790476ccbab
Author: Antonio Vazquez
Date:   Sun Mar 1 18:58:41 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rBf5bafbfedec8a65707a51e30d7125790476ccbab

GPencil: Fix Animation menu

The old animation menu is enough and don't need a new Keyframe menu

===================================================================

M	release/scripts/presets/keyconfig/keymap_data/blender_default.py
M	release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py

===================================================================

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index 334f591f874..0caeba8f20c 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -3171,7 +3171,7 @@ def km_grease_pencil_stroke_edit_mode(params):
         # Active layer
         op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
         # Keyframe menu
-        op_menu("GPENCIL_MT_frames", {"type": 'I', "value": 'PRESS'}),
+        op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 'PRESS'}),
         # Context menu
         *_template_items_context_menu("VIEW3D_MT_gpencil_edit_context_menu", params.context_menu_event),
     ])
@@ -3218,7 +3218,7 @@ def km_grease_pencil_stroke_paint_mode(params):
         # Active layer
         op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
         # Keyframe menu
-        op_menu("GPENCIL_MT_frames", {"type": 'I', "value": 'PRESS'}),
+        op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 'PRESS'}),
         # Draw context menu
         *_template_items_context_panel("VIEW3D_PT_gpencil_draw_context_menu", params.context_menu_event),
     ])
@@ -3378,7 +3378,7 @@ def km_grease_pencil_stroke_sculpt_mode(params):
         # Active layer
         op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
         # Keyframe menu
-        op_menu("GPENCIL_MT_frames", {"type": 'I', "value": 'PRESS'}),
+        op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 'PRESS'}),
         # Context menu
         *_template_items_context_panel("VIEW3D_PT_gpencil_sculpt_context_menu", params.context_menu_event),
     ])
@@ -3590,7 +3590,7 @@ def km_grease_pencil_stroke_weight_mode(params):
         # Active layer
         op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
         # Keyframe menu
-        op_menu("GPENCIL_MT_frames", {"type": 'I', "value": 'PRESS'}),
+        op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 'PRESS'}),
         # Context menu
         *_template_items_context_panel("VIEW3D_PT_gpencil_weight_context_menu", params.context_menu_event),
     ])
@@ -3646,7 +3646,7 @@ def km_grease_pencil_stroke_vertex_mode(params):
         # Active layer
         op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
         # Keyframe menu
-        op_menu("GPENCIL_MT_frames", {"type": 'I', "value": 'PRESS'}),
+        op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 'PRESS'}),
         # Vertex Paint context menu
         op_panel("VIEW3D_PT_gpencil_vertex_context_menu", params.context_menu_event),
     ])
diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index 590102af6df..18acbb54b34 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -2367,7 +2367,7 @@ def km_grease_pencil_stroke_paint_mode(params):
         # Active layer
         op_menu("GPENCIL_MT_layer_active", {"type": 'M', "value": 'PRESS'}),
         # Keyframe menu
-        op_menu("GPENCIL_MT_frames", {"type": 'I', "value": 'PRESS'}),
+        op_menu("VIEW3D_MT_gpencil_animation", {"type": 'I', "value": 'PRESS'}),
     ])
 
     return keymap
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index f49e926795b..cb333fc9506 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -345,6 +345,8 @@ class GPENCIL_MT_layer_active(Menu):
 
     def draw(self, context):
         layout = self.layout
+        layout.operator_context = 'INVOKE_REGION_WIN'
+
         gpd = context.gpencil_data
         if gpd:
             gpl_active = context.active_gpencil_layer
@@ -364,26 +366,6 @@ class GPENCIL_MT_layer_active(Menu):
         layout.operator("gpencil.layer_add", text="New Layer", icon='ADD')
 
 
-class GPENCIL_MT_frames(Menu):
-    bl_label = "Keyframe Menu"
-
-    def draw(self, _context):
-        layout = self.layout
-
-        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 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 Keyframe (Active Layer)").type = 'FRAME'
-        layout.operator("gpencil.active_frames_delete_all", text="Delete Active Keyframe (All Layers)")
-
-
 class GPENCIL_MT_gpencil_draw_delete(Menu):
     bl_label = "Delete"
 
@@ -958,7 +940,6 @@ classes = (
     GPENCIL_MT_cleanup,
     GPENCIL_MT_move_to_layer,
     GPENCIL_MT_layer_active,
-    GPENCIL_MT_frames,
 
     GPENCIL_MT_gpencil_draw_delete,
     GPENCIL_MT_layer_mask_menu,



More information about the Bf-blender-cvs mailing list