[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56380] trunk/blender/source/blender/ editors/sculpt_paint/paint_image_proj.c: project paint unnecessarily split of texure checks into separate checks, calculating the texture coords when outside the falloff.

Campbell Barton ideasman42 at gmail.com
Mon Apr 29 15:07:13 CEST 2013


Revision: 56380
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56380
Author:   campbellbarton
Date:     2013-04-29 13:07:12 +0000 (Mon, 29 Apr 2013)
Log Message:
-----------
project paint unnecessarily split of texure checks into separate checks, calculating the texture coords when outside the falloff.

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

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image_proj.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image_proj.c	2013-04-29 12:07:27 UTC (rev 56379)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image_proj.c	2013-04-29 13:07:12 UTC (rev 56380)
@@ -3853,30 +3853,28 @@
 
 				/*if (dist < radius) {*/ /* correct but uses a sqrtf */
 				if (dist_nosqrt <= radius_squared) {
-					float samplecos[3];
 					dist = sqrtf(dist_nosqrt);
 
 					falloff = BKE_brush_curve_strength_clamp(ps->brush, dist, radius);
 
-					if (ps->is_texbrush) {
-						MTex *mtex = &brush->mtex;
-						/* taking 3d copy to account for 3D mapping too. It gets concatenated during sampling */
-						if (mtex->brush_map_mode == MTEX_MAP_MODE_3D) {
-							copy_v3_v3(samplecos, projPixel->worldCoSS);
-						}
-						else {
-							copy_v2_v2(samplecos, projPixel->projCoSS);
-							samplecos[2] = 0.0f;
-						}
-					}
-
 					if (falloff > 0.0f) {
 						float texrgb[3];
 						float mask = falloff * BKE_brush_alpha_get(ps->scene, brush);
 
 						if (ps->is_texbrush) {
+							MTex *mtex = &brush->mtex;
+							float samplecos[3];
 							float texrgba[4];
 
+							/* taking 3d copy to account for 3D mapping too. It gets concatenated during sampling */
+							if (mtex->brush_map_mode == MTEX_MAP_MODE_3D) {
+								copy_v3_v3(samplecos, projPixel->worldCoSS);
+							}
+							else {
+								copy_v2_v2(samplecos, projPixel->projCoSS);
+								samplecos[2] = 0.0f;
+							}
+
 							/* note, for clone and smear, we only use the alpha, could be a special function */
 							BKE_brush_sample_tex_3D(ps->scene, brush, samplecos, texrgba, thread_index, pool);
 




More information about the Bf-blender-cvs mailing list