[Bf-blender-cvs] [2dfdff0c2e5] greasepencil-object: WIP: Improve interface for fill brush

Antonio Vazquez noreply at git.blender.org
Thu Jan 4 09:42:22 CET 2018


Commit: 2dfdff0c2e5638d36f73ff4387ac4f2fc6d2fdce
Author: Antonio Vazquez
Date:   Thu Jan 4 09:37:20 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB2dfdff0c2e5638d36f73ff4387ac4f2fc6d2fdce

WIP: Improve interface for fill brush

Now is possible to delete it and can have several of them.

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	source/blender/editors/gpencil/gpencil_data.c
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 ab2c5c60a09..2733cb4e2aa 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -365,9 +365,11 @@ class GreasePencilBrushPanel:
 
         # Brush details
         if brush is not None:
-            row = layout.row()
+            row = layout.row(align=False)
             row.prop(brush, "name", text="")
-            if brush.is_fill_only is False:
+            row = layout.row(align=False)
+            row.prop(brush, "fill_only", text="Fill Brush")
+            if brush.fill_only is False:
                 row = layout.row(align=True)
                 row.prop(brush, "use_random_pressure", text="", icon='RNDCURVE')
                 row.prop(brush, "line_width", text="Radius")
@@ -380,13 +382,16 @@ class GreasePencilBrushPanel:
                 row = layout.row(align=False)
                 row.prop(context.tool_settings, "use_gpencil_draw_onback", text="Draw on Back")
 
-            if brush.is_fill_only is True:
-                row = layout.row(align=True)
-                row.prop(brush, "fill_threshold", text="Threshold")
+            if brush.fill_only is True:
                 row = layout.row(align=True)
                 row.prop(brush, "fill_leak", text="Leak Size")
+
                 row = layout.row(align=True)
-                row.prop(brush, "fill_hide", text="Hide Lines")
+                row.prop(brush, "fill_hide", text="Hide Transparent Lines")
+                row = layout.row(align=True)
+                row.enabled = brush.fill_hide
+                row.prop(brush, "fill_threshold", text="Threshold")
+
                 row = layout.row(align=True)
                 row.prop(brush, "fill_show_boundary", text="Show Boundary Lines")
 
@@ -1017,7 +1022,7 @@ class GPENCIL_MT_gpencil_draw_specials(Menu):
         brush = context.active_gpencil_brush
         i = 0
         for palcolor in palette.colors:
-            if brush is None or brush.is_fill_only is False:
+            if brush is None or brush.fill_only is False:
                 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_data.c b/source/blender/editors/gpencil/gpencil_data.c
index 82abc72700a..784486b3b46 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -1361,11 +1361,6 @@ static int gp_brush_remove_exec(bContext *C, wmOperator *op)
 		return OPERATOR_CANCELLED;
 	}
 
-	if (brush->flag & GP_BRUSH_FILL_ONLY) {
-		BKE_report(op->reports, RPT_ERROR, "The fill brush cannot be deleted");
-		return OPERATOR_CANCELLED;
-	}
-
 	/* make the brush before this the new active brush
 	 * - use the one after if this is the first
 	 * - if this is the only brush, this naturally becomes NULL
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index ad9d42ac56e..3cd54b11707 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2357,7 +2357,7 @@ static void rna_def_gpencil_brush(BlenderRNA *brna)
 	RNA_def_property_boolean_default(prop, true);
 	RNA_def_property_ui_text(prop, "Enable Cursor", "Enable cursor on screen");
 
-	prop = RNA_def_property(srna, "is_fill_only", PROP_BOOLEAN, PROP_NONE);
+	prop = RNA_def_property(srna, "fill_only", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_ONLY);
 	RNA_def_property_boolean_default(prop, true);
 	RNA_def_property_ui_text(prop, "Fill Only", "The brush is only for filling strokes");
@@ -2370,7 +2370,7 @@ static void rna_def_gpencil_brush(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "fill_hide", PROP_BOOLEAN, PROP_NONE);
 	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 s boundary for filling");
+	RNA_def_property_ui_text(prop, "Hide", "Hide transparent lines to use as boundary for filling");
 }
 
 /* Grease Pencil Drawing Brushes API */



More information about the Bf-blender-cvs mailing list