[Bf-blender-cvs] [b99c616b9bd] master: Fix T68414: GPencil crash after using L key and Ctrl+Z in Draw Mode

Antonio Vazquez noreply at git.blender.org
Sat Aug 10 16:04:47 CEST 2019


Commit: b99c616b9bd6218e18c6ecf13558b4a2a756d294
Author: Antonio Vazquez
Date:   Sat Aug 10 10:44:44 2019 +0200
Branches: master
https://developer.blender.org/rBb99c616b9bd6218e18c6ecf13558b4a2a756d294

Fix T68414: GPencil crash after using L key and Ctrl+Z in Draw Mode

There is a segment fault because the operator was in modal but the Ctrl+Z breaks the custom data. Now, the Ctrl+Z ends the operator.

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

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 06ff0e744b9..894fb6eced4 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -3460,12 +3460,18 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
   /* We don't pass on key events, GP is used with key-modifiers -
    * prevents Dkey to insert drivers. */
   if (ISKEYBOARD(event->type)) {
-    if (ELEM(event->type, LEFTARROWKEY, DOWNARROWKEY, RIGHTARROWKEY, UPARROWKEY, ZKEY)) {
+    if (ELEM(event->type, LEFTARROWKEY, DOWNARROWKEY, RIGHTARROWKEY, UPARROWKEY)) {
       /* allow some keys:
        *   - for frame changing [#33412]
        *   - for undo (during sketching sessions)
        */
     }
+    else if (event->type == ZKEY) {
+      if (event->ctrl) {
+        p->status = GP_STATUS_DONE;
+        estate = OPERATOR_FINISHED;
+      }
+    }
     else if (ELEM(event->type, PAD0, PAD1, PAD2, PAD3, PAD4, PAD5, PAD6, PAD7, PAD8, PAD9)) {
       /* allow numpad keys so that camera/view manipulations can still take place
        * - PAD0 in particular is really important for Grease Pencil drawing,



More information about the Bf-blender-cvs mailing list