diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-08-02 17:24:24 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-08-02 17:25:49 +0300 |
commit | 455a1e210bccccf6fdf7fff5981a2495360e1d58 (patch) | |
tree | 0732eb547dec8cffb65d72e3f62632bc61a82697 | |
parent | 9198ff4306792ea5a1eb9c818a61cdd32ef3d7e2 (diff) |
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
-rw-r--r-- | source/blender/editors/gpencil/gpencil_primitive.c | 7 |
1 files changed, 6 insertions, 1 deletions
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, |