[Bf-blender-cvs] [a93881d704] master: GPencil: Pressing 'B' while in 'Continuous Drawing' mode will create a blank frame

Joshua Leung noreply at git.blender.org
Wed Jan 18 15:11:43 CET 2017


Commit: a93881d70433853c2f77a13bb176a9758316811b
Author: Joshua Leung
Date:   Thu Jan 19 02:24:41 2017 +1300
Branches: master
https://developer.blender.org/rBa93881d70433853c2f77a13bb176a9758316811b

GPencil: Pressing 'B' while in 'Continuous Drawing' mode will create a blank frame

This is a hardcoded keymapping that just calls the "Add Blank Frame" operator
introduced in the previous commit.

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

M	source/blender/editors/gpencil/gpencil_paint.c

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

diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index c23bfb1ff6..c2228a932f 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -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;
 		}




More information about the Bf-blender-cvs mailing list