[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30339] trunk/blender/source/blender/ editors/sculpt_paint/sculpt.c: * removed unneeded autosmooth_overlap, forgot to remove before merge

Jason Wilkins Jason.A.Wilkins at gmail.com
Wed Jul 14 22:04:05 CEST 2010


Revision: 30339
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30339
Author:   jwilkins
Date:     2010-07-14 22:04:02 +0200 (Wed, 14 Jul 2010)

Log Message:
-----------
* removed unneeded autosmooth_overlap, forgot to remove before merge
* replaced omp critical sections, code either crashes or does not function correctly without them

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

Modified: trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2010-07-14 19:59:32 UTC (rev 30338)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c	2010-07-14 20:04:02 UTC (rev 30339)
@@ -229,8 +229,6 @@
 	int alt_smooth;
 
 	float plane_trim_squared;
-
-	float autosmooth_overlap;
 } StrokeCache;
 
 /* ===== OPENGL =====
@@ -580,7 +578,7 @@
 /* Return modified brush strength. Includes the direction of the brush, positive
    values pull vertices, negative values push. Uses tablet pressure and a
    special multiplier found experimentally to scale the strength factor. */
-static float brush_strength(Sculpt *sd, StrokeCache *cache, float feather, float overlap)
+static float brush_strength(Sculpt *sd, StrokeCache *cache, float feather)
 {
 	Brush *brush = paint_brush(&sd->paint);
 
@@ -590,6 +588,8 @@
 	float pressure     = brush->flag & BRUSH_ALPHA_PRESSURE	? cache->pressure : 1;
 	float pen_flip     = cache->pen_flip ? -1 : 1;
 	float invert       = cache->invert ? -1 : 1;
+	float accum        = integrate_overlap(brush);
+	float overlap      = (brush->flag & BRUSH_SPACE_ATTEN && brush->flag & BRUSH_SPACE && !(brush->flag & BRUSH_ANCHORED)) && (brush->spacing < 100) ? 1.0f/accum : 1; // spacing is integer percentage of radius, divide by 50 to get normalized diameter
 	float flip         = dir * invert * pen_flip;
 
 	switch(brush->sculpt_tool){
@@ -912,7 +912,7 @@
 			BLI_pbvh_vertex_iter_end;
 		}
 
-		//#pragma omp critical
+		#pragma omp critical
 		{
 			add_v3_v3(an, private_an);
 			add_v3_v3(out_flip, private_out_flip);
@@ -1065,7 +1065,7 @@
 	BLI_pbvh_node_get_grids(ss->pbvh, node, &grid_indices, &totgrid,
 		NULL, &gridsize, &griddata, &gridadj);
 
-	//#pragma omp critical
+	#pragma omp critical
 	{
 		tmpgrid= MEM_mallocN(sizeof(float)*3*gridsize*gridsize, "tmpgrid");
 		tmprow=  MEM_mallocN(sizeof(float)*3*gridsize, "tmprow");
@@ -1150,7 +1150,7 @@
 		}
 	}
 
-	//#pragma omp critical
+	#pragma omp critical
 	{
 		MEM_freeN(tmpgrid);
 		MEM_freeN(tmprow);
@@ -2403,10 +2403,10 @@
 
 		if (brush->sculpt_tool != SCULPT_TOOL_SMOOTH && brush->autosmooth_factor > 0) {
 			if (brush->flag & BRUSH_INVERSE_SMOOTH_PRESSURE) {
-				smooth(sd, ss, nodes, totnode, brush->autosmooth_factor*(1-ss->cache->pressure)*ss->cache->autosmooth_overlap);
+				smooth(sd, ss, nodes, totnode, brush->autosmooth_factor*(1-ss->cache->pressure));
 			}
 			else {
-				smooth(sd, ss, nodes, totnode, brush->autosmooth_factor*ss->cache->autosmooth_overlap);
+				smooth(sd, ss, nodes, totnode, brush->autosmooth_factor);
 			}
 		}
 
@@ -2580,13 +2580,9 @@
 	int i;
 
 	float feather = calc_symmetry_feather(sd, ss->cache);
-	float accum   = integrate_overlap(brush);
-	float overlap = (brush->flag & BRUSH_SPACE_ATTEN && brush->flag & BRUSH_SPACE && !(brush->flag & BRUSH_ANCHORED)) && (brush->spacing < 100) ? 1.0f/accum : 1; // spacing is integer percentage of radius, divide by 50 to get normalized diameter
 
-	ss->cache->autosmooth_overlap = overlap;
+	cache->bstrength= brush_strength(sd, cache, feather);
 
-	cache->bstrength= brush_strength(sd, cache, feather, overlap);
-
 	cache->symmetry= symm;
 
 	/* symm is a bit combination of XYZ - 1 is mirror X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */ 





More information about the Bf-blender-cvs mailing list