From abfdd1c697b5cd276bdd0c5dfda8fd2b48ff24f0 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Tue, 18 Feb 2020 11:11:22 +0100 Subject: [PATCH] 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. --- source/blender/editors/gpencil/gpencil_edit.c | 7 +++++++ 1 file changed, 7 insertions(+) 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);