diff options
author | Joshua Leung <aligorith@gmail.com> | 2014-10-23 16:04:15 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2014-10-23 16:04:15 +0400 |
commit | 527d1593e8e1b6fc466b47f018cc87ff7db5cf85 (patch) | |
tree | 36343d69f955a07080d78e554d978e56ddae5380 | |
parent | 79236d5b81bac009d4e058dc11cbdbe9e4c20189 (diff) |
UI and properties support for having "Filled" GPencil Strokes/Shapes
-rw-r--r-- | release/scripts/startup/bl_ui/properties_grease_pencil_common.py | 30 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_gpencil_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil.c | 18 |
3 files changed, 34 insertions, 15 deletions
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 00b75e9f924..3720495f200 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 b13d4c5a7ec..48cc396363e 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 fe70c81a79d..d1e8aa7c80d 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"); |