[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39282] branches/soc-2011-onion/source/ blender/editors/sculpt_paint/paint_uv.c: another mini optimization

Antony Riakiotakis kalast at gmail.com
Thu Aug 11 01:31:02 CEST 2011


Revision: 39282
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39282
Author:   psy-fi
Date:     2011-08-10 23:31:01 +0000 (Wed, 10 Aug 2011)
Log Message:
-----------
another mini optimization

Modified Paths:
--------------
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_uv.c

Modified: branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_uv.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_uv.c	2011-08-10 23:28:26 UTC (rev 39281)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_uv.c	2011-08-10 23:31:01 UTC (rev 39282)
@@ -350,9 +350,11 @@
 	int invert;
 	int width, height;
 	float aspectRatio;
+	float alpha;
 	Brush *brush = paint_brush(smoothbrushdata->uvpaint);
+
 	invert = RNA_boolean_get(op->ptr, "invert")? -1 : 1;
-
+	alpha = brush_alpha(brush)*invert;
 	UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &co[0], &co[1]);
 
 	radius = brush_size(brush);
@@ -373,7 +375,7 @@
 			diff[1] /= aspectRatio;
 			if((dist = dot_v2v2(diff, diff)) <= radius){
 				float strength;
-				strength = brush_alpha(brush)*brush_curve_strength(brush, dist, radius);
+				strength = alpha*brush_curve_strength(brush, dist, radius);
 				normalize_v2(diff);
 				mt->uv[i][0] -= invert*strength*diff[0]*0.001;
 				mt->uv[i][1] -= invert*strength*diff[1]*0.001;




More information about the Bf-blender-cvs mailing list