From e7a0a75919fd2e33869b4b8efbf0e69bf5904ea7 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Fri, 2 Apr 2021 13:45:51 +0200 Subject: Fix T87131: SVG as GPencil elements with both Stroke and Fill fails The importer was not checking if both were enabled. Now a new material is created if it's needed. --- source/blender/io/gpencil/intern/gpencil_io_import_svg.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc index 4894cfc1ada..dc76b6ed661 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc @@ -118,15 +118,17 @@ bool GpencilImporterSVG::read() } /* Create_shape materials. */ - const char *const mat_names[] = {"Stroke", "Fill"}; + const char *const mat_names[] = {"Stroke", "Fill", "Both"}; int index = 0; - if ((is_stroke) && (is_fill)) { + if ((is_stroke) && (!is_fill)) { index = 0; - is_fill = false; } else if ((!is_stroke) && (is_fill)) { index = 1; } + else if ((is_stroke) && (is_fill)) { + index = 2; + } int32_t mat_index = create_material(mat_names[index], is_stroke, is_fill); /* Loop all paths to create the stroke data. */ -- cgit v1.2.3