From c1730ed16568784552678908becfad2389ac391f Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Wed, 4 Aug 2021 15:54:54 +0200 Subject: GPencil: New Brush option to define Caps type This is used to set the default caps type for the stroke. Before always was rounded and only could be changed later in Edit mode Two new buttons has been added to topbar. NOTE: New icons are been designed (T90414) The buttons are expanded to list in Properties panel. Reviewed By: mendio, HooglyBoogly Differential Revision: https://developer.blender.org/D11999 --- source/blender/editors/gpencil/gpencil_paint.c | 3 +++ source/blender/editors/gpencil/gpencil_primitive.c | 3 +++ 2 files changed, 6 insertions(+) (limited to 'source/blender/editors') diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index d6f6dbb2b10..aaea1c0ddaf 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -996,6 +996,9 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) gps->inittime = p->inittime; gps->uv_scale = 1.0f; + /* Set stroke caps. */ + gps->caps[0] = gps->caps[1] = brush->gpencil_settings->caps_type; + /* allocate enough memory for a continuous array for storage points */ const int subdivide = brush->gpencil_settings->draw_subdivide; diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c index cf49aefe2ea..27374f21b66 100644 --- a/source/blender/editors/gpencil/gpencil_primitive.c +++ b/source/blender/editors/gpencil/gpencil_primitive.c @@ -335,6 +335,9 @@ static void gpencil_primitive_set_initdata(bContext *C, tGPDprimitive *tgpi) gps->uv_scale = 1.0f; gps->inittime = 0.0f; + /* Set stroke caps. */ + gps->caps[0] = gps->caps[1] = brush->gpencil_settings->caps_type; + /* Apply the vertex color to fill. */ ED_gpencil_fill_vertex_color_set(ts, brush, gps); -- cgit v1.2.3