Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2021-07-21 22:04:38 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-07-21 22:04:38 +0300
commit4dc14fdbd3a04003f9158b2a17a23d228c75be7e (patch)
tree9c5d47e01c1d81132f073f19da94d7e1db6e7af4 /source/blender/editors/gpencil/gpencil_asset.c
parent3e8c2efd5820dcb0013ab359e4c3e2f059a033e5 (diff)
GPencil: Fix error importing layers
The layer need to be duplicated in order to keep all details.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_asset.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_asset.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_asset.c b/source/blender/editors/gpencil/gpencil_asset.c
index 34ac274d204..4b7cd84afaf 100644
--- a/source/blender/editors/gpencil/gpencil_asset.c
+++ b/source/blender/editors/gpencil/gpencil_asset.c
@@ -863,8 +863,9 @@ static void gpencil_asset_add_strokes(tGPDasset *tgpa)
/* Check if Layer is in target datablock. */
bGPDlayer *gpl_target = BKE_gpencil_layer_get_by_name(gpd_target, gpl_asset->info, false);
if (gpl_target == NULL) {
- gpl_target = BKE_gpencil_layer_addnew(gpd_target, gpl_asset->info, false, false);
+ gpl_target = BKE_gpencil_layer_duplicate(gpl_asset, false, false);
BLI_assert(gpl_target != NULL);
+ BLI_addtail(&gpd_target->layers, gpl_target);
if (tgpa->asset_layers == NULL) {
tgpa->asset_layers = BLI_ghash_ptr_new(__func__);