Commit: 455a1e210bccccf6fdf7fff5981a2495360e1d58
Author: Antonio Vazquez
Date:   Fri Aug 2 16:24:24 2019 +0200
Branches: master
https://developer.blender.org/rB455a1e210bccccf6fdf7fff5981a2495360e1d58

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

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

M       source/blender/editors/gpencil/gpencil_primitive.c

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

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,

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

Reply via email to