Grease Pencil: Crash weight painting on stroke with generative modifier [subdivide] - also generative modifiers create actual editable points? #78884

Closed
opened 2020-07-13 15:32:04 +02:00 by Sergey Kulnevsky · 14 comments

System Information
Operating system: Windows-10-10.0.16299-SP0 64 Bits
Graphics card: Intel(R) HD Graphics 530 Intel 4.5.0 - Build 22.20.16.4836

Blender Version
Broken: version: 2.83.2, branch: master, commit date: 2020-07-09 05:50, hash: 239fbf7d93

Short description of error
Blender crashes when you are trying draw weight on subdevided grease pensil object (does not seem to happen on the regular meshes).

Exact steps for others to reproduce the error
0. Open attachment.

  1. Try to draw weight on grease pencil object.
    CrashGreasePenscilArmatureSubdivide.blend

What I have done:
create a new grease pencil object (Blank)
In Draw mode make some figure.
In Edit mode make few simplifies.
In Object mode add Subdivide; add armature; set perrent with empty groups
In Weigth paint mode try to draw weigth
Crash.

Sorry. My English not so good. I hope, I have create a good description.

**System Information** Operating system: Windows-10-10.0.16299-SP0 64 Bits Graphics card: Intel(R) HD Graphics 530 Intel 4.5.0 - Build 22.20.16.4836 **Blender Version** Broken: version: 2.83.2, branch: master, commit date: 2020-07-09 05:50, hash: `239fbf7d93` **Short description of error** Blender crashes when you are trying draw weight on subdevided grease pensil object (does not seem to happen on the regular meshes). **Exact steps for others to reproduce the error** 0. Open attachment. 1. Try to draw weight on grease pencil object. [CrashGreasePenscilArmatureSubdivide.blend](https://archive.blender.org/developer/F8691430/CrashGreasePenscilArmatureSubdivide.blend) What I have done: create a new grease pencil object (Blank) In Draw mode make some figure. In Edit mode make few simplifies. In Object mode add Subdivide; add armature; set perrent with empty groups In Weigth paint mode try to draw weigth Crash. Sorry. My English not so good. I hope, I have create a good description.

Added subscriber: @dlavsevo

Added subscriber: @dlavsevo

#79610 was marked as duplicate of this issue

#79610 was marked as duplicate of this issue

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Crash wasn't immediate, but not really problem to reproduce.

Exception thrown: read access violation. dw was 0xFFFFFFFFFFFFFFFF.

>	blender.exe!BKE_defvert_find_index(const MDeformVert * dvert, const int defgroup) Line 675	C

 	blender.exe!BKE_defvert_ensure_index(MDeformVert * dvert, const int defgroup) Line 702	C
 	blender.exe!brush_draw_apply(tGP_BrushWeightpaintData * gso, bGPDstroke * gps, int pt_index, const int radius, const int * co) Line 261	C
 	blender.exe!gpencil_weightpaint_brush_do_frame(bContext * C, tGP_BrushWeightpaintData * gso, bGPDlayer * gpl, bGPDframe * gpf, const float[4] * diff_mat) Line 548	C
 	blender.exe!gpencil_weightpaint_brush_apply_to_layers(bContext * C, tGP_BrushWeightpaintData * gso) Line 619	C
 	blender.exe!gpencil_weightpaint_brush_apply(bContext * C, wmOperator * op, PointerRNA * itemptr) Line 661	C
 	blender.exe!gpencil_weightpaint_brush_apply_event(bContext * C, wmOperator * op, const wmEvent * event) Line 704	C
 	blender.exe!gpencil_weightpaint_brush_modal(bContext * C, wmOperator * op, const wmEvent * event) Line 781	C
 	blender.exe!wm_handler_operator_call(bContext * C, ListBase * handlers, wmEventHandler * handler_base, wmEvent * event, PointerRNA * properties, const unsigned char * kmi_idname) Line 2018	C
 	blender.exe!wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2806	C
 	blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2854	C
 	blender.exe!wm_event_do_handlers(bContext * C) Line 3283	C
 	blender.exe!WM_main(bContext * C) Line 478	C
 	blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 534	C
Crash wasn't immediate, but not really problem to reproduce. `Exception thrown: read access violation. dw was 0xFFFFFFFFFFFFFFFF.` ``` > blender.exe!BKE_defvert_find_index(const MDeformVert * dvert, const int defgroup) Line 675 C blender.exe!BKE_defvert_ensure_index(MDeformVert * dvert, const int defgroup) Line 702 C blender.exe!brush_draw_apply(tGP_BrushWeightpaintData * gso, bGPDstroke * gps, int pt_index, const int radius, const int * co) Line 261 C blender.exe!gpencil_weightpaint_brush_do_frame(bContext * C, tGP_BrushWeightpaintData * gso, bGPDlayer * gpl, bGPDframe * gpf, const float[4] * diff_mat) Line 548 C blender.exe!gpencil_weightpaint_brush_apply_to_layers(bContext * C, tGP_BrushWeightpaintData * gso) Line 619 C blender.exe!gpencil_weightpaint_brush_apply(bContext * C, wmOperator * op, PointerRNA * itemptr) Line 661 C blender.exe!gpencil_weightpaint_brush_apply_event(bContext * C, wmOperator * op, const wmEvent * event) Line 704 C blender.exe!gpencil_weightpaint_brush_modal(bContext * C, wmOperator * op, const wmEvent * event) Line 781 C blender.exe!wm_handler_operator_call(bContext * C, ListBase * handlers, wmEventHandler * handler_base, wmEvent * event, PointerRNA * properties, const unsigned char * kmi_idname) Line 2018 C blender.exe!wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2806 C blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2854 C blender.exe!wm_event_do_handlers(bContext * C) Line 3283 C blender.exe!WM_main(bContext * C) Line 478 C blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 534 C ```

so. what I can do with this information? will this mistake resolved at some version of blender? i think this problem is not critical. i do not know, why i have used subdivide.

so. what I can do with this information? will this mistake resolved at some version of blender? i think this problem is not critical. i do not know, why i have used subdivide.

In #78884#980740, @dlavsevo wrote:
so. what I can do with this information? will this mistake resolved at some version of blender? i think this problem is not critical. i do not know, why i have used subdivide.

It's for developers to see where crash happened

> In #78884#980740, @dlavsevo wrote: > so. what I can do with this information? will this mistake resolved at some version of blender? i think this problem is not critical. i do not know, why i have used subdivide. It's for developers to see where crash happened
Member

Added subscribers: @antoniov, @lichtwerk

Added subscribers: @antoniov, @lichtwerk
Member

Armature modifier is not neccessary to show the issue.

Could it be that there is something fundamentaly "wrong" (or at least very different compared to mesh modifiers) with the "show_in_editmode" modifier option with greasepencil and generative modifiers?
For mesh objects, the editmesh control points (vertices) are always the same, even for generative modifiers:

  • adding geometry (e.g. subdivision modifier) will of course add geometry, but the editcage is the same.
  • removing geometry (e.g. weld modifier) will of course remove geometry, but the editcage is the same.

For greasepencil the above is not the same:

  • adding geometry (e.g. subdivide modifier) will of course add to the stroke, but these appears as editable control points (you cannot select them though, you cannot vertex paint on them [no crash here though] etc)
  • removing geometry (e.g. simplify modifier) will of course remove from the stroke, but then you can only edit remaining control points (select, vertex paint, weight paint), leading to unexpected results when you disable the "show_in_editmode" modifier option again.

So in the case of this report, indices of the deformgroup cannot match, leading to crash.
It is also weird that those generative modifiers do their thing in the deformStroke callbacks, should these be more in the generateStrokes callbacks?
Crash can probably avoided, but to me this sound like it could go wrong in many, many other places.

@antoniov : is this really by design? (dare setting to High prio for clarification)

Armature modifier is not neccessary to show the issue. Could it be that there is something fundamentaly "wrong" (or at least very different compared to mesh modifiers) with the "show_in_editmode" modifier option with greasepencil and generative modifiers? For mesh objects, the editmesh control points (vertices) are always the same, even for generative modifiers: - adding geometry (e.g. subdivision modifier) will of course add geometry, but the editcage is the same. - removing geometry (e.g. weld modifier) will of course remove geometry, but the editcage is the same. For greasepencil the above is not the same: - adding geometry (e.g. subdivide modifier) will of course add to the stroke, but these appears as editable control points (you cannot select them though, you cannot vertex paint on them [no crash here though] etc) - removing geometry (e.g. simplify modifier) will of course remove from the stroke, but then you can only edit remaining control points (select, vertex paint, weight paint), leading to unexpected results when you disable the "show_in_editmode" modifier option again. So in the case of this report, indices of the deformgroup cannot match, leading to crash. It is also weird that those generative modifiers do their thing in the `deformStroke` callbacks, should these be more in the `generateStrokes` callbacks? Crash can probably avoided, but to me this sound like it could go wrong in many, many other places. @antoniov : is this really by design? (dare setting to High prio for clarification)
Philipp Oeser changed title from Crash subdivided Grease Pensil in Weight paint mode to Grease Pencil: Crash weight painting on stroke with generative modifier [subdivide] - also generative modifiers create actual editable points? 2020-07-31 17:46:03 +02:00

The generateStrokes callback is only designed to add new strokes, never to modifiy existing strokes. The simplify or subdivide are using an existing stroke.

I'm going to look at the problem.

The `generateStrokes` callback is only designed to add new strokes, never to modifiy existing strokes. The simplify or subdivide are using an existing stroke. I'm going to look at the problem.
Antonio Vazquez self-assigned this 2020-07-31 18:05:26 +02:00

This issue was referenced by 39d7c111db

This issue was referenced by 39d7c111dbed051d5ac29e7f05fb9b346e4f0ce7

This issue was referenced by 71683be4bb

This issue was referenced by 71683be4bb6e8bb65844a48b282c3c5662839b1c

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Member

Added subscriber: @babakkarimiasl

Added subscriber: @babakkarimiasl
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#78884
No description provided.