[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50608] trunk/blender/source/blender/ editors/sculpt_paint/paint_stroke.c: fix [#32381] Sculpt: crash when using radius sensitivity

Campbell Barton ideasman42 at gmail.com
Sat Sep 15 01:34:00 CEST 2012


Revision: 50608
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50608
Author:   campbellbarton
Date:     2012-09-14 23:34:00 +0000 (Fri, 14 Sep 2012)
Log Message:
-----------
fix [#32381] Sculpt: crash when using radius sensitivity

Modified Paths:
--------------
    trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2012-09-14 23:11:47 UTC (rev 50607)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_stroke.c	2012-09-14 23:34:00 UTC (rev 50608)
@@ -254,7 +254,10 @@
 				pressure = event_tablet_data(event, NULL);
 			
 			if (pressure > FLT_EPSILON) {
-				scale = (BKE_brush_size_get(scene, stroke->brush) * pressure * stroke->brush->spacing / 50.0f) / length;
+				/* brushes can have a minimum size of 1.0 but with pressure it can be smaller then a pixel
+				 * causing very high step sizes, hanging blender [#32381] */
+				const float size_clamp = maxf(1.0f, BKE_brush_size_get(scene, stroke->brush) * pressure);
+				scale = (size_clamp * stroke->brush->spacing / 50.0f) / length;
 				if (scale > FLT_EPSILON) {
 					mul_v2_fl(vec, scale);
 




More information about the Bf-blender-cvs mailing list