[Bf-blender-cvs] [4b644ea59fe] greasepencil-object: Enable Draw on Back for fill Brushes

Antonio Vazquez noreply at git.blender.org
Sat Jan 6 14:17:48 CET 2018


Commit: 4b644ea59fed02ab8e740c56ff25295e16ec310e
Author: Antonio Vazquez
Date:   Sat Jan 6 14:17:42 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB4b644ea59fed02ab8e740c56ff25295e16ec310e

Enable Draw on Back for fill Brushes

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	source/blender/editors/gpencil/gpencil_fill.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 3989d12c2ff..ffc37b98dc9 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -380,9 +380,6 @@ class GreasePencilBrushPanel:
                 row.prop(brush, "strength", slider=True)
                 row.prop(brush, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
 
-                row = layout.row(align=False)
-                row.prop(context.tool_settings, "use_gpencil_draw_onback", text="Draw on Back")
-
             if brush.fill_only is True:
                 row = layout.row(align=True)
                 row.prop(brush, "fill_leak", text="Leak Size")
@@ -402,6 +399,8 @@ class GreasePencilBrushPanel:
                 row = layout.row(align=True)
                 row.prop(brush, "fill_allow_stroke_only", text="Allow Colors without fill")
 
+            row = layout.row(align=False)
+            row.prop(context.tool_settings, "use_gpencil_draw_onback", text="Draw on Back")
 
 class GreasePencilBrushOptionsPanel:
     # subclass must set
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index a7fd0211d1e..a452038d77d 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -676,7 +676,12 @@ static void gpencil_stroke_from_stack(tGPDfill *tgpf)
 	gps->flag |= GP_STROKE_RECALC_CACHES;
 
 	/* add stroke to frame */
-	BLI_addtail(&tgpf->gpf->strokes, gps);
+	if (ts->gpencil_flags & GP_TOOL_FLAG_PAINT_ONBACK) {
+		BLI_addhead(&tgpf->gpf->strokes, gps);
+	}
+	else {
+		BLI_addtail(&tgpf->gpf->strokes, gps);
+	}
 
 	/* add points */
 	pt = gps->points;



More information about the Bf-blender-cvs mailing list