[Bf-blender-cvs] [d6f896da226] blender2.8: GP: Add strength factor for eraser brush

Antonioya noreply at git.blender.org
Thu Sep 13 18:37:10 CEST 2018


Commit: d6f896da22649551f7115531b1a37c13e0c071a3
Author: Antonioya
Date:   Thu Sep 13 18:34:34 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBd6f896da22649551f7115531b1a37c13e0c071a3

GP: Add strength factor for eraser brush

This gives more control.

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

M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/editors/gpencil/gpencil_paint.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index e1f9abfdae7..9f60563dff7 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1421,11 +1421,11 @@ class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel):
             if gp_settings.gpencil_brush_type == 'ERASE':
                 row = layout.row(align=True)
                 row.prop(brush, "size", text="Radius")
-                row.prop(gp_settings, "use_pressure", text="", icon='STYLUS_PRESSURE')
+                row = layout.row(align=True)
+                row.prop(gp_settings, "pen_strength", slider=True)
+                row.prop(gp_settings, "use_strength_pressure", text="", icon='STYLUS_PRESSURE')
 
-                col = layout.column(align=True)
-                col.separator()
-                row = col.row()
+                row = layout.row(align=True)
                 row.prop(gp_settings, "eraser_mode", expand=True)
             elif gp_settings.gpencil_brush_type == 'FILL':
                 col = layout.column(align=True)
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index dcee4c06132..1aea1e467b0 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1307,11 +1307,13 @@ static float gp_stroke_eraser_calc_influence(tGPsdata *p, const int mval[2], con
 	CLAMP(distance, 0.0f, (float)radius);
 	fac = 1.0f - (distance / (float)radius);
 
+	/* apply strength factor */
+	fac *= brush->gpencil_settings->draw_strength;
+
 	/* Control this further using pen pressure */
 	if (brush->gpencil_settings->flag & GP_BRUSH_USE_PRESSURE) {
 		fac *= p->pressure;
 	}
-
 	/* Return influence factor computed here */
 	return fac;
 }



More information about the Bf-blender-cvs mailing list