[Bf-blender-cvs] [abfdd1c697b] master: Fix T73960: GPencil can't convert while it is a separate from old strokes

Antonio Vazquez noreply at git.blender.org
Tue Feb 18 11:11:37 CET 2020


Commit: abfdd1c697b5cd276bdd0c5dfda8fd2b48ff24f0
Author: Antonio Vazquez
Date:   Tue Feb 18 11:11:22 2020 +0100
Branches: master
https://developer.blender.org/rBabfdd1c697b5cd276bdd0c5dfda8fd2b48ff24f0

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.

===================================================================

M	source/blender/editors/gpencil/gpencil_edit.c

===================================================================

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);



More information about the Bf-blender-cvs mailing list