[Bf-blender-cvs] [568f55e3cc3] greasepencil-object: New Draw Specials menu with X key

Antonio Vazquez noreply at git.blender.org
Sat Dec 9 17:10:19 CET 2017


Commit: 568f55e3cc323404bf9361fb5073d99315c98620
Author: Antonio Vazquez
Date:   Sat Dec 9 16:50:33 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rB568f55e3cc323404bf9361fb5073d99315c98620

New Draw Specials menu with X key

Now this menu only has the option to delete frame, but can hold more options in the future.

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	source/blender/editors/gpencil/gpencil_ops.c

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

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 e12c2d47821..e55c480021a 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -930,7 +930,16 @@ class GPENCIL_MT_gpencil_edit_specials(Menu):
             layout.operator("gpencil.reproject")
 
 
-###############################
+class GPENCIL_MT_gpencil_draw_specials(Menu):
+    bl_label = "GPencil Draw Specials"
+
+    def draw(self, context):
+        layout = self.layout
+        is_3d_view = context.space_data.type == 'VIEW_3D'
+
+        layout.operator_context = 'INVOKE_REGION_WIN'
+
+        layout.operator("gpencil.active_frames_delete_all", text="Delete Frame")
 
 
 class GPENCIL_UL_brush(UIList):
@@ -1554,6 +1563,7 @@ classes = (
     GPENCIL_MT_pie_sculpt,
     GPENCIL_MT_snap,
     GPENCIL_MT_gpencil_edit_specials,
+    GPENCIL_MT_gpencil_draw_specials,
     GPENCIL_UL_brush,
     GPENCIL_UL_palettecolor,
     GPENCIL_UL_layer,
diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c
index c3d51d8b4f7..b739a2d9e4e 100644
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -486,6 +486,9 @@ static void ed_keymap_gpencil_painting(wmKeyConfig *keyconf)
 	/* Enter SculptMode */
 	kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_sculptmode_toggle", EKEY, KM_PRESS, 0, 0);
 	RNA_int_set(kmi->ptr, "back", 1);
+
+	/* menu draw specials */
+	WM_keymap_add_menu(keymap, "GPENCIL_MT_gpencil_draw_specials", XKEY, KM_PRESS, 0, 0);
 }
 
 /* Stroke Sculpting Keymap - Only when sculptmode is enabled */



More information about the Bf-blender-cvs mailing list