[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29040] branches/soc-2010-jwilkins/source/ blender/editors/sculpt_paint/sculpt.c: crash fix and clay brush strength fix

Jason Wilkins Jason.A.Wilkins at gmail.com
Fri May 28 05:12:02 CEST 2010


Revision: 29040
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29040
Author:   jwilkins
Date:     2010-05-28 05:12:01 +0200 (Fri, 28 May 2010)

Log Message:
-----------
crash fix and clay brush strength fix

Completely removed thread safe path in calc_area_normal that was causing crash when used with multires.  Only half-way making the necessary changes to disable it is what created the unstable code.

Made clay brush strength dependent on the projected radius of the brush so that it has the same apparent effect no matter what scale the user zooms.

Modified Paths:
--------------
    branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c

Modified: branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c	2010-05-28 02:25:50 UTC (rev 29039)
+++ branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c	2010-05-28 03:12:01 UTC (rev 29040)
@@ -1420,6 +1420,9 @@
     Brush *brush = paint_brush(&sd->paint);
 
     float bstrength = ss->cache->bstrength;
+    static const float atten = 1.0f/8.0f;
+    const float radius = ss->cache->radius;
+
     float displace;
 
     float area_normal[3];
@@ -1435,18 +1438,14 @@
 
     calc_flatten_center(sd, ss, nodes, totnode, center);
 
-    displace = bstrength * MAX_BRUSH_PIXEL_RADIUS/2.0f;
+    displace = bstrength*atten*radius;
 
-    if (displace > ss->cache->radius/2.0f) displace = bstrength * ss->cache->radius/2.0f;
-
     mul_v3_v3v3(temp, area_normal, ss->cache->scale);
     mul_v3_fl(temp, displace);
     add_v3_v3(center, temp);
 
     flip = bstrength < 0;
 
-    if (flip) bstrength = -bstrength;
-
     for (n = 0; n < totnode; n++) {
         PBVHVertexIter vd;
         SculptBrushTest test;





More information about the Bf-blender-cvs mailing list