[Bf-blender-cvs] [2382732fbcd] temp-gpencil-fill: GPencil: Move below the layer when use Duplicate Empty Keyframes

Antonio Vazquez noreply at git.blender.org
Sun Jan 31 15:55:40 CET 2021


Commit: 2382732fbcdf265c9033fcfcce9381a932afba37
Author: Antonio Vazquez
Date:   Sun Jan 31 15:55:34 2021 +0100
Branches: temp-gpencil-fill
https://developer.blender.org/rB2382732fbcdf265c9033fcfcce9381a932afba37

GPencil: Move below the layer when use Duplicate Empty Keyframes

For this mode is better add the layer below.

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

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

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

diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index e297a806895..913d88f9c89 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -466,9 +466,15 @@ static int gpencil_layer_copy_exec(bContext *C, wmOperator *op)
     return OPERATOR_CANCELLED;
   }
 
-  /* make copy of layer, and add it immediately after the existing layer */
+  /* make copy of layer, and add it immediately after or before the existing layer */
   new_layer = BKE_gpencil_layer_duplicate(gpl, true, dup_strokes);
-  BLI_insertlinkafter(&gpd->layers, gpl, new_layer);
+  if (dup_strokes) {
+    BLI_insertlinkafter(&gpd->layers, gpl, new_layer);
+  }
+  else {
+    /* For empty strokes is better add below. */
+    BLI_insertlinkbefore(&gpd->layers, gpl, new_layer);
+  }
 
   /* ensure new layer has a unique name, and is now the active layer */
   BLI_uniquename(&gpd->layers,



More information about the Bf-blender-cvs mailing list