Greasepencil issue when deleting brush from active tool (incl crash drawing then) #73580

Closed
opened 2020-02-04 11:31:39 +01:00 by Tatar Tudor · 12 comments

System Information
Operating system: windows 10
Graphics card: AMD Radeon RX 5700

Blender Version
Broken: v 2.81a
Worked: with grease pencil

Short description of error
I can't draw anymore, whenever I draw a line the program crash. I appent a set of brushes from here https://cloud.blender.org/p/gallery/5ccfe64353b85e279cf72acd, now even if I delete the brushes and materials it keeps crashing.

Exact steps for others to reproduce the error
first scene pilot.blend

**System Information** Operating system: windows 10 Graphics card: AMD Radeon RX 5700 **Blender Version** Broken: v 2.81a Worked: with grease pencil **Short description of error** I can't draw anymore, whenever I draw a line the program crash. I appent a set of brushes from here https://cloud.blender.org/p/gallery/5ccfe64353b85e279cf72acd, now even if I delete the brushes and materials it keeps crashing. **Exact steps for others to reproduce the error** [first scene pilot.blend](https://archive.blender.org/developer/F8320539/first_scene_pilot.blend)
Author

Added subscriber: @tudi1310

Added subscriber: @tudi1310
Member

Added subscribers: @antoniov, @lichtwerk

Added subscribers: @antoniov, @lichtwerk
Member

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

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

I can confirm in this particular file.

This issue seems to be caused by missing brushes [as you already said, you have deleted them -- I assume by going to the Outliner > Blender File view > Brushes, then choose Delete in the context menu?]
Just a couple of observations:

  • when you do this to a brush that is currently used, GPencil will run into errors like this (due to missing gp_settings)
File "/bin/2.82/scripts/startup/bl_ui/space_view3d.py", line 404, in draw_color_selector
ma = gp_settings.material
AttributeError: 'NoneType' object has no attribute 'material'
File "/bin/2.82/scripts/startup/bl_ui/properties_paint_common.py", line 1004, in brush_basic_gpencil_paint_settings
row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
TypeError: UILayout.prop(): error with argument 1, "data" -  Function.data does not support a 'None' assignment AnyType type
  • if you delete a currently used brush in sculpt mode for example, this is handled more gracefully... (in that you correctly cannot make a stroke then, you first have to select an existing brush again to continue...)

Cannot reproduce the crash from scratch, but in that file, it also happens due to being able to start painting without a valid brush -- missing gp_settings...

1  gp_get_default_eraser                     gpencil_paint.c   1972 0x39bb9a5 
2  gp_init_drawing_brush                     gpencil_paint.c   2040 0x39bbc6c 
3  gp_session_initdata                       gpencil_paint.c   2198 0x39bc192 
4  gp_session_initpaint                      gpencil_paint.c   2241 0x39bc2ad 
5  gpencil_draw_init                         gpencil_paint.c   2638 0x39bcf49 
6  gpencil_draw_invoke                       gpencil_paint.c   3428 0x39bf193 
7  wm_operator_invoke                        wm_event_system.c 1465 0x320c8ac 
8  wm_handler_operator_call                  wm_event_system.c 2339 0x320e90a 
9  wm_handlers_do_keymap_with_keymap_handler wm_event_system.c 2652 0x320f643 
10 wm_handlers_do_intern                     wm_event_system.c 2789 0x320fc5f 
11 wm_handlers_do                            wm_event_system.c 3051 0x3210a03 
12 wm_event_do_handlers                      wm_event_system.c 3504 0x3211ef6 
13 WM_main                                   wm.c              418  0x320593b 
14 main                                      creator.c         518  0x2f3a166 

@antoniov: I guess there is just some refresh missing when deleting the corresponding brush datablock from the active tool?

I can confirm in this particular file. This issue seems to be caused by missing brushes [as you already said, you have deleted them -- I assume by going to the `Outliner` > `Blender File` view > `Brushes`, then choose `Delete` in the context menu?] Just a couple of observations: - when you do this to a brush that is currently used, GPencil will run into errors like this (due to missing `gp_settings`) ``` File "/bin/2.82/scripts/startup/bl_ui/space_view3d.py", line 404, in draw_color_selector ma = gp_settings.material AttributeError: 'NoneType' object has no attribute 'material' ``` ``` File "/bin/2.82/scripts/startup/bl_ui/properties_paint_common.py", line 1004, in brush_basic_gpencil_paint_settings row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE') TypeError: UILayout.prop(): error with argument 1, "data" - Function.data does not support a 'None' assignment AnyType type ``` - if you delete a currently used brush in sculpt mode for example, this is handled more gracefully... (in that you correctly cannot make a stroke then, you first have to select an existing brush again to continue...) Cannot reproduce the crash from scratch, but in that file, it also happens due to being able to start painting without a valid brush -- missing `gp_settings`... ``` 1 gp_get_default_eraser gpencil_paint.c 1972 0x39bb9a5 2 gp_init_drawing_brush gpencil_paint.c 2040 0x39bbc6c 3 gp_session_initdata gpencil_paint.c 2198 0x39bc192 4 gp_session_initpaint gpencil_paint.c 2241 0x39bc2ad 5 gpencil_draw_init gpencil_paint.c 2638 0x39bcf49 6 gpencil_draw_invoke gpencil_paint.c 3428 0x39bf193 7 wm_operator_invoke wm_event_system.c 1465 0x320c8ac 8 wm_handler_operator_call wm_event_system.c 2339 0x320e90a 9 wm_handlers_do_keymap_with_keymap_handler wm_event_system.c 2652 0x320f643 10 wm_handlers_do_intern wm_event_system.c 2789 0x320fc5f 11 wm_handlers_do wm_event_system.c 3051 0x3210a03 12 wm_event_do_handlers wm_event_system.c 3504 0x3211ef6 13 WM_main wm.c 418 0x320593b 14 main creator.c 518 0x2f3a166 ``` @antoniov: I guess there is just some refresh missing when deleting the corresponding brush datablock from the active tool?
Philipp Oeser changed title from Crashing when draw to Greasepencil issue when deleting brush from active tool (incl crash drawing then) 2020-02-05 10:48:56 +01:00

@lichtwerk I will take a look

@lichtwerk I will take a look

This issue was referenced by db0121a009

This issue was referenced by db0121a0099836113e7babe7f006e99e4f6ed69f

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Antonio Vazquez self-assigned this 2020-02-05 11:08:53 +01:00
Member

Changed status from 'Resolved' to: 'Confirmed'

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

@antoniov : crash is I think there is still something wrong:

  • File > New > 2D Animation
  • Outliner > Blender File > Brushes > delete Pencil
  • you are left with no brush selector in the Tool Settings
  • you can get it back [e.g. by going to Erase tool, then back to Draw tool], BUT
  • template_ID_preview is garbled, seems like brush is not completely unasociated from tool? (you should be presented with a blank selector like in mesh sculpt mode)
  • you are still getting an error then:
File "/bin/2.83/scripts/startup/bl_ui/space_view3d.py", line 404, in draw_color_selector
ma = gp_settings.material
AttributeError: 'NoneType' object has no attribute 'material'

mind checking again?

@antoniov : crash is I think there is still something wrong: - `File` > `New` > `2D Animation` - `Outliner` > `Blender File` > `Brushes` > delete `Pencil` - you are left with **no** brush selector in the Tool Settings - you can get it back [e.g. by going to `Erase` tool, then back to `Draw` tool], BUT - `template_ID_preview` is garbled, seems like brush is not completely unasociated from tool? (you should be presented with a blank selector like in mesh sculpt mode) - you are still getting an error then: ``` File "/bin/2.83/scripts/startup/bl_ui/space_view3d.py", line 404, in draw_color_selector ma = gp_settings.material AttributeError: 'NoneType' object has no attribute 'material' ``` mind checking again?

@lichtwerk Can you check with master now... I cannot reproduce it now.

@lichtwerk Can you check with `master` now... I cannot reproduce it now.

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'

We can consider this as solved. If the problem rises again, we can reopen it.

We can consider this as solved. If the problem rises again, we can reopen it.
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
4 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#73580
No description provided.