diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2021-06-26 12:38:37 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2021-06-26 12:38:37 +0300 |
commit | fae5a907d4d1380f087f1226ebbd65d9d0718cc6 (patch) | |
tree | 5a2f2e0db6db4673909f269553b3cf6554841a9a /source/blender/editors/gpencil | |
parent | b5542c1ea4c29c56338706158578c41f6e65df5c (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')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 5 |
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); |