[Bf-blender-cvs] [e7a0a75919f] master: Fix T87131: SVG as GPencil elements with both Stroke and Fill fails

Antonio Vazquez noreply at git.blender.org
Fri Apr 2 13:46:02 CEST 2021


Commit: e7a0a75919fd2e33869b4b8efbf0e69bf5904ea7
Author: Antonio Vazquez
Date:   Fri Apr 2 13:45:51 2021 +0200
Branches: master
https://developer.blender.org/rBe7a0a75919fd2e33869b4b8efbf0e69bf5904ea7

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.

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

M	source/blender/io/gpencil/intern/gpencil_io_import_svg.cc

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

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. */



More information about the Bf-blender-cvs mailing list