[Bf-blender-cvs] [db0121a0099] blender-v2.82-release: Fix T73580: Gpencil crash when try to draw without eraser brush available
Antonio Vazquez
noreply at git.blender.org
Wed Feb 5 11:08:37 CET 2020
Commit: db0121a0099836113e7babe7f006e99e4f6ed69f
Author: Antonio Vazquez
Date: Wed Feb 5 11:08:15 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBdb0121a0099836113e7babe7f006e99e4f6ed69f
Fix T73580: Gpencil crash when try to draw without eraser brush available
===================================================================
M release/scripts/startup/bl_ui/properties_paint_common.py
M source/blender/editors/gpencil/gpencil_paint.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 93bf5eca052..8b4f86b2879 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -996,6 +996,8 @@ def brush_basic_texpaint_settings(layout, context, brush, *, compact=False):
def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False):
gp_settings = brush.gpencil_settings
tool = context.workspace.tools.from_space_view3d_mode(context.mode, create=False)
+ if gp_settings is None:
+ return
# Brush details
if brush.gpencil_tool == 'ERASE':
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 6a91417e7f3..e07071e5e67 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1963,6 +1963,9 @@ static Brush *gp_get_default_eraser(Main *bmain, ToolSettings *ts)
Paint *paint = &ts->gp_paint->paint;
Brush *brush_old = paint->brush;
for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) {
+ if (brush->gpencil_settings == NULL) {
+ continue;
+ }
if ((brush->ob_mode == OB_MODE_PAINT_GPENCIL) && (brush->gpencil_tool == GPAINT_TOOL_ERASE)) {
/* save first eraser to use later if no default */
if (brush_dft == NULL) {
More information about the Bf-blender-cvs
mailing list