[Bf-blender-cvs] [e97f357b19f] greasepencil-object: Annotations: Set better default name for new annotation layers

Joshua Leung noreply at git.blender.org
Thu Jun 28 16:48:28 CEST 2018


Commit: e97f357b19ff41cb0db440457ac53bfdb4f3d40f
Author: Joshua Leung
Date:   Fri Jun 29 02:41:38 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rBe97f357b19ff41cb0db440457ac53bfdb4f3d40f

Annotations: Set better default name for new annotation layers

Note: Many of the add layer operators still need tweaks,
but this is a good start for the main ones.

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

M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/editors/gpencil/annotate_paint.c
M	source/blender/editors/gpencil/gpencil_paint.c

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

diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 9ab1a9383f7..50b78c95fff 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -429,7 +429,11 @@ bGPDlayer *BKE_gpencil_layer_addnew(bGPdata *gpd, const char *name, bool setacti
 
 	/* auto-name */
 	BLI_strncpy(gpl->info, name, sizeof(gpl->info));
-	BLI_uniquename(&gpd->layers, gpl, DATA_("GP_Layer"), '.', offsetof(bGPDlayer, info), sizeof(gpl->info));
+	BLI_uniquename(&gpd->layers, gpl,
+	               (gpd->flag & GP_DATA_ANNOTATIONS) ? DATA_("Note") : DATA_("GP_Layer"),
+	               '.',
+	               offsetof(bGPDlayer, info),
+	               sizeof(gpl->info));
 
 	/* make this one the active one */
 	if (setactive)
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index 8b7c4c6e92b..311e9ca5b50 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -1287,7 +1287,7 @@ static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, Deps
 	/* get active layer (or add a new one if non-existent) */
 	p->gpl = BKE_gpencil_layer_getactive(p->gpd);
 	if (p->gpl == NULL) {
-		p->gpl = BKE_gpencil_layer_addnew(p->gpd, "GP_Layer", true);
+		p->gpl = BKE_gpencil_layer_addnew(p->gpd, DATA_("Note"), true);
 
 		if (p->custom_color[3])
 			copy_v3_v3(p->gpl->color, p->custom_color);
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index c9af3ea1106..54517f6a956 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1934,7 +1934,7 @@ static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, Deps
 	/* get active layer (or add a new one if non-existent) */
 	p->gpl = BKE_gpencil_layer_getactive(p->gpd);
 	if (p->gpl == NULL) {
-		p->gpl = BKE_gpencil_layer_addnew(p->gpd, "GP_Layer", true);
+		p->gpl = BKE_gpencil_layer_addnew(p->gpd, DATA_("GP_Layer"), true);
 
 		if (p->custom_color[3])
 			copy_v3_v3(p->gpl->color, p->custom_color);



More information about the Bf-blender-cvs mailing list