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-06-26 12:38:37 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-06-26 12:38:37 +0300
commitfae5a907d4d1380f087f1226ebbd65d9d0718cc6 (patch)
tree5a2f2e0db6db4673909f269553b3cf6554841a9a /source/blender/editors/gpencil/gpencil_edit.c
parentb5542c1ea4c29c56338706158578c41f6e65df5c (diff)
GPencil: Duplicate Masks when separate Layer/Strokes
Now, the mask layers are copied and later a cleanup is done in order to verify all mask layer exist in destination object. If the layer mask does not exist, it's removed from the list. This is related to T89234.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_edit.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 71e03f093b4..b1c0060981a 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -4619,6 +4619,8 @@ static int gpencil_stroke_separate_exec(bContext *C, wmOperator *op)
if (gpl_dst == NULL) {
gpl_dst = BKE_gpencil_layer_addnew(gpd_dst, gpl->info, false, false);
BKE_gpencil_layer_copy_settings(gpl, gpl_dst);
+ /* Copy masks. */
+ BKE_gpencil_layer_mask_copy(gpl, gpl_dst);
}
/* add frame if not created before */
@@ -4737,6 +4739,9 @@ static int gpencil_stroke_separate_exec(bContext *C, wmOperator *op)
}
ob_dst->actcol = actcol;
+ /* Remove any invalid Mask relationship. */
+ BKE_gpencil_layer_mask_cleanup_all_layers(gpd_dst);
+
DEG_id_tag_update(&gpd_src->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
DEG_id_tag_update(&gpd_dst->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);