[Bf-blender-cvs] [8869939d58f] greasepencil-object: Annotations: Restore color selector per layer

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


Commit: 8869939d58f43a785ce75904e9f27f92eef2eb33
Author: Joshua Leung
Date:   Fri Jun 29 02:29:19 2018 +1200
Branches: greasepencil-object
https://developer.blender.org/rB8869939d58f43a785ce75904e9f27f92eef2eb33

Annotations: Restore color selector per layer

This shows up in the layer list, making it possible to quickly change it
inline, and to see what color the strokes in the layer are using.

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesrna/intern/rna_gpencil.c

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

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index 49e01447a3d..9e0ae2c7860 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -719,12 +719,12 @@ class GPENCIL_UL_annotation_layer(UIList):
             if gpl.lock:
                 layout.active = False
 
-            row = layout.row(align=True)
-            #row.prop(gpl, "color")
-            row.prop(gpl, "info", text="", emboss=False)
+            split = layout.split(percentage=0.2)
+            split.prop(gpl, "color", text="", emboss=True)
+            split.prop(gpl, "info", text="", emboss=False)
 
             row = layout.row(align=True)
-            row.prop(gpl, "lock", text="", emboss=False)
+            # row.prop(gpl, "lock", text="", emboss=False)
             row.prop(gpl, "hide", text="", emboss=False)
         elif self.layout_type == 'GRID':
             layout.alignment = 'CENTER'
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 0bfb74389ae..48f4d54cc0f 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -247,7 +247,7 @@ typedef struct bGPDlayer {
 	short flag;				/* settings for layer */
 	short thickness;		/* current thickness to apply to strokes */
 
-	float color[4];			/* Color for strokes in layers (replaced by palettecolor). Only used for ruler (which uses GPencil internally) */
+	float color[4];			/* Color for strokes in layers. Used for annotations, and for ruler (which uses GPencil internally) */
 	float fill[4];			/* Fill color for strokes in layers.  Not used and replaced by palettecolor fill */
 
 	char info[128];			/* optional reference info about this layer (i.e. "director's comments, 12/3")
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 14aa6221063..27e18be0e1d 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -980,6 +980,14 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Opacity", "Layer Opacity");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
 
+	/* Stroke Drawing Color (Annotations) */
+	prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
+	RNA_def_property_array(prop, 3);
+	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_ui_text(prop, "Color", "Color for all strokes in this layer");
+	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+
+
 	/* Tint Color */
 	prop = RNA_def_property(srna, "tint_color", PROP_FLOAT, PROP_COLOR_GAMMA);
 	RNA_def_property_float_sdna(prop, NULL, "tintcolor");



More information about the Bf-blender-cvs mailing list