From 455a1e210bccccf6fdf7fff5981a2495360e1d58 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Fri, 2 Aug 2019 16:24:24 +0200 Subject: [PATCH] Fix T68021: GPencil After using eraser when draw primitives, next primitive has missing handles The problem was related to wrong Brush. After using the Eraser or Fill, the default brush was not the drawing one, so the handles were missing. Now, the operator force the drawing brush. Reviewer: @campbellbarton Differential Revision: http://developer.blender.org/D5403 --- source/blender/editors/gpencil/gpencil_primitive.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c index bdc65e7172a..816517d6ef9 100644 --- a/source/blender/editors/gpencil/gpencil_primitive.c +++ b/source/blender/editors/gpencil/gpencil_primitive.c @@ -1127,7 +1127,12 @@ static void gpencil_primitive_init(bContext *C, wmOperator *op) if ((paint->brush == NULL) || (paint->brush->gpencil_settings == NULL)) { BKE_brush_gpencil_presets(C); } - tgpi->brush = paint->brush; + + /* Set Draw brush. */ + Brush *brush = BKE_paint_toolslots_brush_get(paint, 0); + BKE_brush_tool_set(brush, paint, 0); + BKE_paint_brush_set(paint, brush); + tgpi->brush = brush; /* control points */ tgpi->gpd->runtime.cp_points = MEM_callocN(sizeof(bGPDcontrolpoint) * MAX_CP,