[Bf-blender-cvs] [6f0549b5399] greasepencil-object: GPencil: Split Keyframe menu to i key from context menu

Antonio Vazquez noreply at git.blender.org
Sun Mar 1 09:21:51 CET 2020


Commit: 6f0549b5399e32088a4baeb7c9b8f7b0c90f9eef
Author: Antonio Vazquez
Date:   Sun Mar 1 09:21:44 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rB6f0549b5399e32088a4baeb7c9b8f7b0c90f9eef

GPencil: Split Keyframe menu to i key from context menu

Now it's not in the context 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
M	release/scripts/startup/bl_ui/space_view3d.py

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

diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
index efbf0055b9d..d050be99989 100644
--- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py
+++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py
@@ -3170,6 +3170,8 @@ def km_grease_pencil_stroke_edit_mode(params):
          {"properties": [("mode", 2)]}),
         # Active layer
         op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
+        # Keyframe menu
+        op_menu("GPENCIL_MT_frames", {"type": 'I', "value": 'PRESS'}),
         # Context menu
         *_template_items_context_menu("VIEW3D_MT_gpencil_edit_context_menu", params.context_menu_event),
     ])
@@ -3215,6 +3217,8 @@ def km_grease_pencil_stroke_paint_mode(params):
          {"properties": [("unselected", True)]}),
         # Active layer
         op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
+        # Keyframe menu
+        op_menu("GPENCIL_MT_frames", {"type": 'I', "value": 'PRESS'}),
         # Draw context menu
         *_template_items_context_panel("VIEW3D_PT_gpencil_draw_context_menu", params.context_menu_event),
     ])
@@ -3369,6 +3373,8 @@ def km_grease_pencil_stroke_sculpt_mode(params):
         *_grease_pencil_display(),
         # Active layer
         op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
+        # Keyframe menu
+        op_menu("GPENCIL_MT_frames", {"type": 'I', "value": 'PRESS'}),
         # Context menu
         *_template_items_context_panel("VIEW3D_PT_gpencil_sculpt_context_menu", params.context_menu_event),
     ])
@@ -3575,6 +3581,8 @@ def km_grease_pencil_stroke_weight_mode(params):
         *_grease_pencil_display(),
         # Active layer
         op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
+        # Keyframe menu
+        op_menu("GPENCIL_MT_frames", {"type": 'I', "value": 'PRESS'}),
         # Context menu
         *_template_items_context_panel("VIEW3D_PT_gpencil_weight_context_menu", params.context_menu_event),
     ])
@@ -3625,6 +3633,8 @@ def km_grease_pencil_stroke_vertex_mode(params):
         op_tool("builtin.brush.Smear", {"type": 'K', "value": 'PRESS'}),
         # Active layer
         op_menu("GPENCIL_MT_layer_active", {"type": 'Y', "value": 'PRESS'}),
+        # Keyframe menu
+        op_menu("GPENCIL_MT_frames", {"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 d2aa2dc93f4..590102af6df 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -2366,6 +2366,8 @@ def km_grease_pencil_stroke_paint_mode(params):
         op_tool_cycle("builtin.cursor", {"type": 'C', "value": 'PRESS'}),
         # Active layer
         op_menu("GPENCIL_MT_layer_active", {"type": 'M', "value": 'PRESS'}),
+        # Keyframe menu
+        op_menu("GPENCIL_MT_frames", {"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 c16e49c72a9..08df7bad82c 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -364,6 +364,26 @@ 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"
 
@@ -938,6 +958,7 @@ 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,
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index a92c03450af..4f1c1cb6f89 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -6832,25 +6832,6 @@ def draw_gpencil_layer_active(context, layout):
             row.operator("gpencil.layer_remove", text="", icon='X')
 
 
-def draw_gpencil_keyframe_buttons(layout):
-        layout.label(text="Keyframe")
-
-        layout.operator_context = 'INVOKE_REGION_WIN'
-
-        layout.operator("gpencil.blank_frame_add", text="Insert Blank Keyframe (Active Layer)", icon='ADD')
-        layout.operator("gpencil.blank_frame_add", text="Insert Blank Keyframe (All Layers)", icon='ADD').all_layers = True
-
-        layout.separator()
-
-        layout.operator("gpencil.frame_duplicate", text="Duplicate Active Keyframe (Active Layer)", icon='DUPLICATE')
-        layout.operator("gpencil.frame_duplicate", text="Duplicate Active Keyframe (All Layers)", icon='DUPLICATE').mode = 'ALL'
-
-        layout.separator()
-
-        layout.operator("gpencil.delete", text="Delete Active Keyframe (Active Layer)", icon='REMOVE').type = 'FRAME'
-        layout.operator("gpencil.active_frames_delete_all", text="Delete Active Keyframe (All Layers)", icon='REMOVE')
-
-
 class VIEW3D_PT_gpencil_sculpt_context_menu(Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'WINDOW'
@@ -6870,9 +6851,6 @@ class VIEW3D_PT_gpencil_sculpt_context_menu(Panel):
         # Layers
         draw_gpencil_layer_active(context, layout)
 
-        # Frames
-        draw_gpencil_keyframe_buttons(layout)
-
 
 class VIEW3D_PT_gpencil_weight_context_menu(Panel):
     bl_space_type = 'VIEW_3D'
@@ -6894,9 +6872,6 @@ class VIEW3D_PT_gpencil_weight_context_menu(Panel):
         # Layers
         draw_gpencil_layer_active(context, layout)
 
-        # Frames
-        draw_gpencil_keyframe_buttons(layout)
-
 
 class VIEW3D_PT_gpencil_draw_context_menu(Panel):
     bl_space_type = 'VIEW_3D'
@@ -6930,9 +6905,6 @@ class VIEW3D_PT_gpencil_draw_context_menu(Panel):
         # Layers
         draw_gpencil_layer_active(context, layout)
 
-        # Frames
-        draw_gpencil_keyframe_buttons(layout)
-
 
 class VIEW3D_PT_gpencil_vertex_context_menu(Panel):
     bl_space_type = 'VIEW_3D'
@@ -6971,9 +6943,6 @@ class VIEW3D_PT_gpencil_vertex_context_menu(Panel):
         # Layers
         draw_gpencil_layer_active(context, layout)
 
-        # Frames
-        draw_gpencil_keyframe_buttons(layout)
-
 
 class VIEW3D_PT_paint_vertex_context_menu(Panel):
     # Only for popover, these are dummy values.



More information about the Bf-blender-cvs mailing list