[Bf-blender-cvs] [ae2b161dcc7] temp-gpencil-io: GPencil: Change SVG imported layer name
Antonio Vazquez
noreply at git.blender.org
Thu Feb 11 20:09:47 CET 2021
Commit: ae2b161dcc70e0c2855223b4f928891c4e851ec5
Author: Antonio Vazquez
Date: Thu Feb 11 20:09:42 2021 +0100
Branches: temp-gpencil-io
https://developer.blender.org/rBae2b161dcc70e0c2855223b4f928891c4e851ec5
GPencil: Change SVG imported layer name
===================================================================
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 f1c62edbc32..49e1072b570 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc
@@ -93,11 +93,13 @@ bool GpencilImporterSVG::read(void)
char prv_id[70] = {"*"};
int prefix = 0;
for (NSVGshape *shape = svg_data->shapes; shape; shape = shape->next) {
- char *layer_id = BLI_sprintfN("%03d_%s", prefix, shape->id_parent);
+ char *layer_id = (shape->id_parent[0] == '\0') ? BLI_sprintfN("Layer_%03d", prefix) :
+ BLI_sprintfN("%s", shape->id_parent);
if (!STREQ(prv_id, layer_id)) {
prefix++;
MEM_freeN(layer_id);
- layer_id = BLI_sprintfN("%03d_%s", prefix, shape->id_parent);
+ layer_id = (shape->id_parent[0] == '\0') ? BLI_sprintfN("Layer_%03d", prefix) :
+ BLI_sprintfN("%s", shape->id_parent);
strcpy(prv_id, layer_id);
}
More information about the Bf-blender-cvs
mailing list