[Bf-blender-cvs] [527d159] GPencil_FillStrokes: UI and properties support for having "Filled" GPencil Strokes/Shapes

Joshua Leung noreply at git.blender.org
Wed Oct 29 13:44:53 CET 2014


Commit: 527d1593e8e1b6fc466b47f018cc87ff7db5cf85
Author: Joshua Leung
Date:   Fri Oct 24 01:04:15 2014 +1300
Branches: GPencil_FillStrokes
https://developer.blender.org/rB527d1593e8e1b6fc466b47f018cc87ff7db5cf85

UI and properties support for having "Filled" GPencil Strokes/Shapes

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

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 00b75e9..3720495 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -278,21 +278,25 @@ class GreasePencilDataPanel():
         split = layout.split(percentage=0.5)
         split.active = not gpl.lock
 
-        # Column 1 - Appearance
-        col = split.column()
-
-        subcol = col.column(align=True)
-        subcol.prop(gpl, "color", text="")
-        subcol.prop(gpl, "alpha", slider=True)
-
-        #if debug:
-        #   col.prop(gpl, "show_points")
-
-        # Column 2 - Options (& Current Frame)
+        # Column 1 - Stroke
         col = split.column(align=True)
+        col.label(text="Stroke:")
+        col.prop(gpl, "color", text="")
+        col.prop(gpl, "alpha", slider=True)
 
-        col.prop(gpl, "line_width", slider=True)
-        col.prop(gpl, "show_x_ray")
+        # Column 2 - Fill
+        col = split.column(align=True)
+        col.label(text="Fill:")
+        col.prop(gpl, "fill_color", text="")
+        col.prop(gpl, "fill_alpha", text="Opacity", slider=True)
+		
+        # Options
+        row = layout.row()
+        row.prop(gpl, "line_width", slider=True)
+        row.prop(gpl, "show_x_ray")
+		
+        #if debug:
+        #   layout.prop(gpl, "show_points")
 
         layout.separator()
 
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index b13d4c5..48cc396 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -120,6 +120,7 @@ typedef struct bGPDlayer {
 	float gcolor_next[3];	/* optional color for ghosts after the active frame */
 	
 	float color[4];			/* color that should be used to draw all the strokes in this layer */
+	float fill[4];			/* color that should be used for drawing "fills" for strokes */
 	
 	char info[128];			/* optional reference info about this layer (i.e. "director's comments, 12/3")
 							 * this is used for the name of the layer  too and kept unique. */
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index fe70c81..d1e8aa7 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -596,7 +596,7 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
 	RNA_def_property_editable_func(prop, "rna_GPencilLayer_active_frame_editable");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
 
-	/* Drawing Color */
+	/* Stroke Drawing Color */
 	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);
@@ -605,10 +605,24 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
 	
 	prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "color[3]");
-	RNA_def_property_range(prop, 0.3, 1.0f);
+	RNA_def_property_range(prop, 0.0, 1.0f);
 	RNA_def_property_ui_text(prop, "Opacity", "Layer Opacity");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
 	
+	/* Fill Drawing Color */
+	prop = RNA_def_property(srna, "fill_color", PROP_FLOAT, PROP_COLOR_GAMMA);
+	RNA_def_property_float_sdna(prop, NULL, "fill");
+	RNA_def_property_array(prop, 3);
+	RNA_def_property_range(prop, 0.0f, 1.0f);
+	RNA_def_property_ui_text(prop, "Fill Color", "Color for filling insides of strokes in this layer");
+	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+	
+	prop = RNA_def_property(srna, "fill_alpha", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "fill[3]");
+	RNA_def_property_range(prop, 0.0, 1.0f);
+	RNA_def_property_ui_text(prop, "Fill Opacity", "Opacity for filling insides of strokes");
+	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+	
 	/* Line Thickness */
 	prop = RNA_def_property(srna, "line_width", PROP_INT, PROP_PIXEL);
 	RNA_def_property_int_sdna(prop, NULL, "thickness");




More information about the Bf-blender-cvs mailing list