diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-09-01 23:47:23 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-09-01 23:47:23 +0300 |
commit | 928e0258fea7c51f07ac4214f6aa87a7e4eea1ff (patch) | |
tree | f4bef6a4e25e4b42d3c3c29369243afc4a4eae11 /source/blender/blenkernel/intern/gpencil.c | |
parent | 35bc4c2cf483dc96768fc56fb288b2a7f9deb2ff (diff) |
GPencil: Set fill material when curve is 2D and has filling
Now the material is set as fill if the curve is 2D and is filled with a material. This is done in the Convert operator only, because the SVG add-on works totally different due the SVG has more parameters to determine the type of filling.
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil.c')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 240ae4756a6..0244f11b6f8 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -2788,10 +2788,15 @@ static void gpencil_convert_spline(Main *bmain, mat_curve = give_current_material(ob_cu, 1); linearrgb_to_srgb_v3_v3(mat_gp->gp_style->stroke_rgba, &mat_curve->r); mat_gp->gp_style->stroke_rgba[3] = mat_curve->a; - /* Set stroke to on. */ - mat_gp->gp_style->flag |= GP_STYLE_STROKE_SHOW; - /* Set fill to off. */ - mat_gp->gp_style->flag &= ~GP_STYLE_FILL_SHOW; + /* Set fill and stroke depending of curve type (3D or 2D). */ + if ((cu->flag & CU_3D) || ((cu->flag & (CU_FRONT | CU_BACK)) == 0)) { + mat_gp->gp_style->flag |= GP_STYLE_STROKE_SHOW; + mat_gp->gp_style->flag &= ~GP_STYLE_FILL_SHOW; + } + else { + mat_gp->gp_style->flag &= ~GP_STYLE_STROKE_SHOW; + mat_gp->gp_style->flag |= GP_STYLE_FILL_SHOW; + } } } } |