GPencil: Pressing 'B' while in 'Continuous Drawing' mode will create a blank frame
authorJoshua Leung <aligorith@gmail.com>
Wed, 18 Jan 2017 13:24:41 +0000 (02:24 +1300)
committerJoshua Leung <aligorith@gmail.com>
Wed, 18 Jan 2017 14:06:42 +0000 (03:06 +1300)
This is a hardcoded keymapping that just calls the "Add Blank Frame" operator
introduced in the previous commit.

source/blender/editors/gpencil/gpencil_paint.c

index c23bfb1ff607443a50362cbd2443ce7541ec26c2..c2228a932feb5ee56c046a2a69834b4011937289 100644 (file)
@@ -2432,6 +2432,14 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
                        /* enable continuous if release D key in mid drawing */
                        p->scene->toolsettings->gpencil_flags |= GP_TOOL_FLAG_PAINTSESSIONS_ON;
                }
+               else if ((event->type == BKEY) && (event->val == KM_RELEASE)) {
+                       /* Add Blank Frame
+                        * - Since this operator is non-modal, we can just call it here, and keep going...
+                * - This operator is especially useful when animating
+                        */
+                       WM_operator_name_call(C, "GPENCIL_OT_blank_frame_add", WM_OP_EXEC_DEFAULT, NULL);
+                       estate = OPERATOR_RUNNING_MODAL;
+               }
                else {
                        estate = OPERATOR_RUNNING_MODAL;
                }