[Bf-blender-cvs] [7e568797728] master: Fix T52696: Sculpt - Brush spacing pressure artifacts

Joshua Leung noreply at git.blender.org
Mon Sep 11 08:25:24 CEST 2017


Commit: 7e5687977287a0a8551a3593ebe60733b1c14af7
Author: Joshua Leung
Date:   Mon Sep 11 18:24:39 2017 +1200
Branches: master
https://developer.blender.org/rB7e5687977287a0a8551a3593ebe60733b1c14af7

Fix T52696: Sculpt - Brush spacing pressure artifacts

Was caused by divide-by-zero in paint_stroke_integrate_overlap()
in paint_stroke.c, as identified by Bob Smith (uvwxyz).

Thanks for the report!

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

M	source/blender/editors/sculpt_paint/paint_stroke.c

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

diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 05270dbfa09..bb2cd52a41e 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -580,7 +580,10 @@ static float paint_stroke_integrate_overlap(Brush *br, float factor)
 			max = overlap;
 	}
 
-	return 1.0f / max;
+	if (max == 0.0f)
+		return 1.0f;
+	else
+		return 1.0f / max;
 }
 
 static float paint_space_stroke_spacing_variable(const Scene *scene, PaintStroke *stroke, float pressure, float dpressure, float length)



More information about the Bf-blender-cvs mailing list