[Bf-blender-cvs] [b1e9fd5e2ba] greasepencil-object: UI: Add alpha to colors in color list

Antonio Vazquez noreply at git.blender.org
Sat Dec 9 17:10:26 CET 2017


Commit: b1e9fd5e2ba13df817f7c865c83a87b74b2ddd5d
Author: Antonio Vazquez
Date:   Sat Dec 9 17:09:57 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rBb1e9fd5e2ba13df817f7c865c83a87b74b2ddd5d

UI: Add alpha to colors in color list

Sometimes is better to access to alpha from here and not from stroke or fill panel.

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	source/blender/makesrna/intern/rna_palette.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 19ba7567c4f..2228167ac00 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -967,8 +967,8 @@ class GPENCIL_UL_palettecolor(UIList):
             split = layout.split(percentage=0.25)
             row = split.row(align=True)
             row.enabled = not palcolor.lock
-            row.prop(palcolor, "color", text="", emboss=palcolor.is_stroke_visible)
-            row.prop(palcolor, "fill_color", text="", emboss=palcolor.is_fill_visible)
+            row.prop(palcolor, "color_full", text="", emboss=palcolor.is_stroke_visible)
+            row.prop(palcolor, "fill_full", text="", emboss=palcolor.is_fill_visible)
             split.prop(palcolor, "name", text="", emboss=False)
 
             row = layout.row(align=True)
diff --git a/source/blender/makesrna/intern/rna_palette.c b/source/blender/makesrna/intern/rna_palette.c
index cb160c5d966..39afbb0b8b8 100644
--- a/source/blender/makesrna/intern/rna_palette.c
+++ b/source/blender/makesrna/intern/rna_palette.c
@@ -251,6 +251,13 @@ static void rna_def_palettecolor(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Color", "");
 	RNA_def_property_update(prop, NC_SCREEN | NC_SCENE | ND_TOOLSETTINGS | ND_DATA | NC_GPENCIL, "rna_Palette_dependency_update");
 
+	prop = RNA_def_property(srna, "color_full", PROP_FLOAT, PROP_COLOR_GAMMA);
+	RNA_def_property_range(prop, 0.0, 1.0);
+	RNA_def_property_float_sdna(prop, NULL, "rgb");
+	RNA_def_property_array(prop, 4);
+	RNA_def_property_ui_text(prop, "Color", "");
+	RNA_def_property_update(prop, NC_SCREEN | NC_SCENE | ND_TOOLSETTINGS | ND_DATA | NC_GPENCIL, "rna_Palette_dependency_update");
+
 	prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_range(prop, 0.0, 1.0);
 	RNA_def_property_float_sdna(prop, NULL, "value");
@@ -285,6 +292,13 @@ static void rna_def_palettecolor(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Fill Color", "Color for filling region bounded by each stroke");
 	RNA_def_property_update(prop, NC_SCREEN | NC_SCENE | ND_TOOLSETTINGS | ND_DATA | NC_GPENCIL, "rna_Palette_dependency_update");
 
+	prop = RNA_def_property(srna, "fill_full", PROP_FLOAT, PROP_COLOR_GAMMA);
+	RNA_def_property_float_sdna(prop, NULL, "fill");
+	RNA_def_property_array(prop, 4);
+	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_ui_text(prop, "Fill Color", "Color for filling region bounded by each stroke");
+	RNA_def_property_update(prop, NC_SCREEN | NC_SCENE | ND_TOOLSETTINGS | ND_DATA | NC_GPENCIL, "rna_Palette_dependency_update");
+
 	/* Fill alpha */
 	prop = RNA_def_property(srna, "fill_alpha", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "fill[3]");



More information about the Bf-blender-cvs mailing list