Grease Pencil: L (key) / cmd z / crash #68414

Closed
opened 2019-08-08 16:23:10 +02:00 by Jadwiga Kowalska · 19 comments

hi there

it happens that blender grease pencil crashes regularly, when I'm in drawing modus and press:
l (L Key) - then cmd+z

best
jadi

System Information
Operating system:
Graphics card:

Blender Version
Broken: (example: 2.80, edbf15d3c0, master, 2018-11-28, as found on the splash screen)
Worked: (optional)

Short description of error

Exact steps for others to reproduce the error
Based on the default startup or an attached .blend file (as simple as possible).

hi there it happens that blender grease pencil crashes regularly, when I'm in drawing modus and press: l (L Key) - then cmd+z best jadi **System Information** Operating system: Graphics card: **Blender Version** Broken: (example: 2.80, edbf15d3c044, master, 2018-11-28, as found on the splash screen) Worked: (optional) **Short description of error** **Exact steps for others to reproduce the error** Based on the default startup or an attached .blend file (as simple as possible).

Added subscriber: @jedi-kawasaki

Added subscriber: @jedi-kawasaki

hi there

it happens that blender grease pencil crashes regularly, when I'm in drawing modus and press:
l (L Key) - then cmd+z

best
jadi

hi there it happens that blender grease pencil crashes regularly, when I'm in drawing modus and press: l (L Key) - then cmd+z best jadi

Added subscribers: @antoniov, @ChristopherAnderssarian

Added subscribers: @antoniov, @ChristopherAnderssarian

@antoniov

  • 2D animation
  • Draw
  • Hold L and Undo
  • Crash
@antoniov - 2D animation - Draw - Hold L and Undo - Crash

Added subscriber: @CharlieJolly

Added subscriber: @CharlieJolly

@CharlieJolly The error is gpencil_paint.c

    GP_Sculpt_Guide *guide = &p->scene->toolsettings->gp_sculpt.guide;
    if (guide->use_guide) {
      ED_workspace_status_text(```

The guide is NULL.
@CharlieJolly The error is `gpencil_paint.c` ```case GP_PAINTMODE_DRAW: { ``` GP_Sculpt_Guide *guide = &p->scene->toolsettings->gp_sculpt.guide; if (guide->use_guide) { ED_workspace_status_text(``` ``` The guide is NULL.
Charlie Jolly was assigned by Antonio Vazquez 2019-08-08 17:24:38 +02:00

I assign to you. If you don't find the problem let me know.

I assign to you. If you don't find the problem let me know.

I have seen after undo, the p has NaN

{

tGPsdata *p = op->customdata;```


I don't know why. It looks the Undo is running while the modal operator is still running.

@ideasman42 any idea here?
I have seen after undo, the `p` has NaN ```static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) { ``` tGPsdata *p = op->customdata;``` ``` I don't know why. It looks the Undo is running while the modal operator is still running. @ideasman42 any idea here?

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Philipp Oeser changed title from L (key) / cmd z / crash to Grease Pencil: L (key) / cmd z / crash 2019-08-09 09:43:22 +02:00

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk

@lichtwerk Not sure this problem is only GP. I tested and the problem is the customdata of the operator is corrupted when use Undo. Not sure if this can be a problem for more operators.

@lichtwerk Not sure this problem is only GP. I tested and the problem is the `customdata` of the operator is corrupted when use Undo. Not sure if this can be a problem for more operators.
Member

@antoniov gpencil_paint.c has undo function but gpencil_primitive.c doesn't. This might be the cause.

Not sure what OPTYPE_UNDO does in this case.

@antoniov gpencil_paint.c has undo function but gpencil_primitive.c doesn't. This might be the cause. Not sure what OPTYPE_UNDO does in this case.

@CharlieJolly No idea...this was old code done before I enter in GP project. If you can, try your ideas and maybe works.

@CharlieJolly No idea...this was old code done before I enter in GP project. If you can, try your ideas and maybe works.
Member

@antoniov I can't get Blender to crash.

@antoniov I can't get Blender to crash.

@CharlieJolly For me fails always.

  1. Open 2D template
  2. Draw something
  3. Press L
  4. Press Ctrl+Z
  5. Crash
@CharlieJolly For me fails always. 1) Open 2D template 2) Draw something 3) Press `L` 4) Press `Ctrl+Z` 5) Crash

@CharlieJolly Proposed fix:

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,
@CharlieJolly Proposed fix: ```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, ```

This issue was referenced by b99c616b9b

This issue was referenced by b99c616b9bd6218e18c6ecf13558b4a2a756d294
Member

@antoniov I've managed to finally reproduce the bug and your fix works.

I can commit the fix under my name but might be better for you to commit as it is your fix!

@antoniov I've managed to finally reproduce the bug and your fix works. I can commit the fix under my name but might be better for you to commit as it is your fix!
Charlie Jolly was unassigned by Antonio Vazquez 2019-08-10 15:59:44 +02:00
Antonio Vazquez self-assigned this 2019-08-10 15:59:44 +02:00

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#68414
No description provided.