From f9917a8d431f5480d9a5d58dfcf84863911f3bf2 Mon Sep 17 00:00:00 2001 From: Antonioya Date: Sat, 15 Dec 2018 09:54:31 +0100 Subject: [PATCH] Fix T59396 Grease pencil brush crash The problem was the brush was not initializated because some code was missing (marked as ToDo) --- release/scripts/startup/bl_ui/space_view3d_toolbar.py | 3 ++- source/blender/editors/sculpt_paint/paint_ops.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 68d334dfaea..eeb00fe09f8 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1485,12 +1485,13 @@ class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel): col = row.column() brush = context.active_gpencil_brush - gp_settings = brush.gpencil_settings sub = col.column(align=True) sub.operator("gpencil.brush_presets_create", icon='HELP', text="") if brush is not None: + gp_settings = brush.gpencil_settings + # XXX: Items in "sub" currently show up beside the brush selector in a separate column if brush.gpencil_tool == 'ERASE': sub.prop(gp_settings, "use_default_eraser", text="") diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index ed40a22bd78..80911cf202f 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -124,7 +124,8 @@ static int brush_add_gpencil_exec(bContext *C, wmOperator *UNUSED(op)) BKE_paint_brush_set(paint, br); - /* TODO init grease pencil specific data */ + /* init grease pencil specific data */ + BKE_brush_init_gpencil_settings(br); return OPERATOR_FINISHED; }