Commit: f9917a8d431f5480d9a5d58dfcf84863911f3bf2
Author: Antonioya
Date:   Sat Dec 15 09:54:31 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBf9917a8d431f5480d9a5d58dfcf84863911f3bf2

Fix T59396 Grease pencil brush crash

The problem was the brush was not initializated because some code was missing 
(marked as ToDo)

===================================================================

M       release/scripts/startup/bl_ui/space_view3d_toolbar.py
M       source/blender/editors/sculpt_paint/paint_ops.c

===================================================================

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;
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to