[Bf-blender-cvs] [2b0c317fb2f] greasepencil-object: New option to fill using colors without fill

Antonio Vazquez noreply at git.blender.org
Thu Jan 4 11:29:31 CET 2018


Commit: 2b0c317fb2fb38fd0dd5e794ceb2e2be14f57743
Author: Antonio Vazquez
Date:   Thu Jan 4 11:13:06 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB2b0c317fb2fb38fd0dd5e794ceb2e2be14f57743

New option to fill using colors without fill

This option allows to use for filling a color without fill. This can be very useful for create clean strokes base on several strokes.

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	source/blender/editors/gpencil/gpencil_fill.c
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesrna/intern/rna_scene.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 ddd2cfb898f..2f5da9bd6d2 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -398,6 +398,9 @@ class GreasePencilBrushPanel:
                 row = layout.row(align=True)
                 row.prop(brush, "fill_show_boundary", text="Show Boundary Lines")
 
+                row = layout.row(align=True)
+                row.prop(brush, "fill_allow_stroke_only", text="Allow Colors without fill")
+
 
 class GreasePencilBrushOptionsPanel:
     # subclass must set
@@ -1024,7 +1027,7 @@ class GPENCIL_MT_gpencil_draw_specials(Menu):
         palette = context.active_gpencil_palette
         brush = context.active_gpencil_brush
         for i, palcolor in enumerate(palette.colors):
-            if brush is None or brush.fill_only is False:
+            if brush is None or brush.fill_only is False or brush.fill_allow_stroke_only is True:
                 layout.operator("palette.palettecolor_choose", text=palcolor.name).index=i
             else:
                 if palcolor.fill_alpha > 0.0:
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 6b7e85ffab8..266d7283e7c 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -923,7 +923,9 @@ static int gpencil_fill_invoke(bContext *C, wmOperator *op, const wmEvent *event
 	}
 
 	/* Must use a color with fill */
-	if (tgpf->palcolor->fill[3] < GPENCIL_ALPHA_OPACITY_THRESH) {
+	if ((tgpf->palcolor->fill[3] < GPENCIL_ALPHA_OPACITY_THRESH) && 
+		((tgpf->flag & GP_BRUSH_FILL_ALLOW_STROKEONLY) == 0)) 
+	{
 		BKE_report(op->reports, RPT_ERROR, "The current color must have fill enabled");
 		gpencil_fill_exit(C, op);
 		return OPERATOR_CANCELLED;
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index c628a57718d..0d76bb12ef1 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -152,6 +152,8 @@ typedef enum eGPDbrush_Flag {
 	GP_BRUSH_FILL_HIDE = (1 << 8),
 	/* fill show boundary lines */
 	GP_BRUSH_FILL_SHOW_BOUNDARY = (1 << 9),
+	/* fill show boundary lines */
+	GP_BRUSH_FILL_ALLOW_STROKEONLY = (1 << 10),
 } eGPDbrush_Flag;
 
 /* ***************************************** */
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 2acb532afcf..5c44a82db73 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2379,6 +2379,12 @@ static void rna_def_gpencil_brush(BlenderRNA *brna)
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_HIDE);
 	RNA_def_property_boolean_default(prop, true);
 	RNA_def_property_ui_text(prop, "Hide", "Hide transparent lines to use as boundary for filling");
+
+	prop = RNA_def_property(srna, "fill_allow_stroke_only", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_ALLOW_STROKEONLY);
+	RNA_def_property_boolean_default(prop, true);
+	RNA_def_property_ui_text(prop, "Allow Stroke Only", "Allow to use colors without fill (this can be used to create clean strokes)");
+
 }
 
 /* Grease Pencil Drawing Brushes API */



More information about the Bf-blender-cvs mailing list