Commit: b2f1b8ab7a59907a81620a98ec5edb0d4d35ec59
Author: Antonioya
Date:   Fri Sep 16 11:48:41 2016 +0200
Branches: master
https://developer.blender.org/rBb2f1b8ab7a59907a81620a98ec5edb0d4d35ec59

GPencil: Add a new special menu for editing and replace subdivision shortcut

Replace the W shortcut for subdivision by a new menu for edit specials
in order to keep consistency in UI.

Subdivision is not used all the time, so it's better assign this
shortcut to menu.

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

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 9432be3..5054125 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -651,6 +651,32 @@ class GPENCIL_MT_snap(Menu):
         layout.operator("view3d.snap_cursor_to_grid", text="Cursor to Grid")
 
 
+class GPENCIL_MT_gpencil_edit_specials(Menu):
+    bl_label = "GPencil 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.stroke_subdivide", text="Subdivide")
+
+        layout.separator()
+
+        layout.operator("gpencil.stroke_join", text="Join").type = 'JOIN'
+        layout.operator("gpencil.stroke_join", text="Join & Copy").type = 
'JOINCOPY'
+        layout.operator("gpencil.stroke_flip", text="Flip Direction")
+
+        gpd = context.gpencil_data
+        if gpd:
+            layout.prop(gpd, "show_stroke_direction", text="Show Directions")
+
+        if is_3d_view:
+            layout.separator()
+            layout.operator("gpencil.reproject")
+
+
 ###############################
 
 
diff --git a/source/blender/editors/gpencil/gpencil_ops.c 
b/source/blender/editors/gpencil/gpencil_ops.c
index 26fcfdc..98cdbad 100644
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -242,8 +242,8 @@ static void ed_keymap_gpencil_editing(wmKeyConfig *keyconf)
        
        WM_keymap_add_item(keymap, "GPENCIL_OT_active_frames_delete_all", XKEY, 
KM_PRESS, KM_SHIFT, 0);
        
-       /* subdivide strokes */
-       WM_keymap_add_item(keymap, "GPENCIL_OT_stroke_subdivide", WKEY, 
KM_PRESS, 0, 0);
+       /* menu edit specials */
+       WM_keymap_add_menu(keymap, "GPENCIL_MT_gpencil_edit_specials", WKEY, 
KM_PRESS, 0, 0);
 
        /* join strokes */
        WM_keymap_add_item(keymap, "GPENCIL_OT_stroke_join", JKEY, KM_PRESS, 
KM_CTRL, 0);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to