GPencil: Added Ctrl-J hotkey for Joining strokes
authorJoshua Leung <aligorith@gmail.com>
Fri, 5 Aug 2016 14:10:27 +0000 (02:10 +1200)
committerJoshua Leung <aligorith@gmail.com>
Fri, 5 Aug 2016 15:49:13 +0000 (03:49 +1200)
(Ctrl-Shift-J is for "Join and Copy")

source/blender/editors/gpencil/gpencil_data.c
source/blender/editors/gpencil/gpencil_intern.h
source/blender/editors/gpencil/gpencil_ops.c

index 95680b05a887bab8967f6a548ba62209bc028af0..c7b1164cb059f75afa727ab067a42a1efea4b07e 100644 (file)
@@ -1209,11 +1209,6 @@ static void gpencil_stroke_join_strokes(bGPDstroke *gps_a, bGPDstroke *gps_b, co
        }
 }
 
-enum {
-       GP_STROKE_JOIN = -1,
-       GP_STROKE_JOINCOPY = 1
-};
-
 static int gp_stroke_join_exec(bContext *C, wmOperator *op)
 {
        bGPdata *gpd = ED_gpencil_data_get_active(C);
index 0ff0878d4cec8d1b5be7b72741662c7750797a7e..f37fba4212df17525d575960641695061f3c407d 100644 (file)
@@ -206,7 +206,7 @@ EnumPropertyItem *ED_gpencil_palettes_enum_itemf(bContext *C, PointerRNA *UNUSED
 
 void GPENCIL_OT_draw(struct wmOperatorType *ot);
 
-/* Paint Modes for operator*/
+/* Paint Modes for operator */
 typedef enum eGPencil_PaintModes {
        GP_PAINTMODE_DRAW = 0,
        GP_PAINTMODE_ERASER,
@@ -275,6 +275,11 @@ void GPENCIL_OT_active_frames_delete_all(struct wmOperatorType *ot);
 
 void GPENCIL_OT_convert(struct wmOperatorType *ot);
 
+enum {
+       GP_STROKE_JOIN = -1,
+       GP_STROKE_JOINCOPY = 1
+};
+
 void GPENCIL_OT_stroke_arrange(struct wmOperatorType *ot);
 void GPENCIL_OT_stroke_change_color(struct wmOperatorType *ot);
 void GPENCIL_OT_stroke_lock_color(struct wmOperatorType *ot);
index 6bbb8f7c96521d69b56d32a42fb4d160cc5bc79e..0f94c680364d220b30fc7779ece0f2cddcc92b09 100644 (file)
@@ -240,6 +240,12 @@ 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);
        
+       /* join strokes */
+       WM_keymap_add_item(keymap, "GPENCIL_OT_stroke_join", JKEY, KM_PRESS, KM_CTRL, 0);
+       
+       kmi = WM_keymap_add_item(keymap, "GPENCIL_OT_stroke_join", JKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
+       RNA_boolean_set(kmi->ptr, "type", GP_STROKE_JOINCOPY);
+       
        /* copy + paste */
        WM_keymap_add_item(keymap, "GPENCIL_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "GPENCIL_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);