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>2020-02-18 13:11:22 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-02-18 13:11:32 +0300
commitabfdd1c697b5cd276bdd0c5dfda8fd2b48ff24f0 (patch)
tree890bbae97f008314e29d687fbb0668b29d87f62b /source/blender/editors/gpencil/gpencil_edit.c
parent5343d0f49400adf6515efcf5b2792edb532cd01c (diff)
Fix T73960: GPencil can't convert while it is a separate from old strokes
The problem was the new object hadn't any layer active.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_edit.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 250ceaf884f..d710e59c569 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -4222,6 +4222,13 @@ static int gp_stroke_separate_exec(bContext *C, wmOperator *op)
}
}
+ /* Ensure destination object has one active layer. */
+ if (gpd_dst->layers.first != NULL) {
+ if (BKE_gpencil_layer_getactive(gpd_dst) == NULL) {
+ BKE_gpencil_layer_setactive(gpd_dst, gpd_dst->layers.first);
+ }
+ }
+
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);