[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56421] trunk/blender/source/blender/ editors/sculpt_paint/paint_image_proj.c: Fix: texture alpha masking not functional after recent commits.

Antony Riakiotakis kalast at gmail.com
Tue Apr 30 22:57:45 CEST 2013


Revision: 56421
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56421
Author:   psy-fi
Date:     2013-04-30 20:57:45 +0000 (Tue, 30 Apr 2013)
Log Message:
-----------
Fix: texture alpha masking not functional after recent commits. Mask is
used to see if area has been covered by brush, so exclude the texture
alpha and texture alpha masks from mask comparisons. Coming next:
texture masks for 2d painting.

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-30 18:57:04 UTC (rev 56420)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image_proj.c	2013-04-30 20:57:45 UTC (rev 56421)
@@ -3833,6 +3833,7 @@
 					if (falloff > 0.0f) {
 						float texrgb[3];
 						float mask = falloff;
+						float mixalpha = 1.0;
 
 						if (ps->is_texbrush) {
 							MTex *mtex = &brush->mtex;
@@ -3852,11 +3853,11 @@
 							BKE_brush_sample_tex_3D(ps->scene, brush, samplecos, texrgba, thread_index, pool);
 
 							copy_v3_v3(texrgb, texrgba);
-							mask *= texrgba[3];
+							mixalpha *= texrgba[3];
 						}
 
 						if (ps->is_maskbrush) {
-							mask *= BKE_brush_sample_masktex(ps->scene, ps->brush, projPixel->projCoSS, thread_index, pool);
+							mixalpha *= BKE_brush_sample_masktex(ps->scene, ps->brush, projPixel->projCoSS, thread_index, pool);
 						}
 
 						CLAMP(mask, 0.0f, 1.0f);
@@ -3924,8 +3925,8 @@
 									else do_projectpaint_soften(ps, projPixel, mask, softenArena, &softenPixels);
 									break;
 								default:
-									if (is_floatbuf) do_projectpaint_draw_f(ps, projPixel, texrgb, mask);
-									else do_projectpaint_draw(ps, projPixel, texrgb, mask);
+									if (is_floatbuf) do_projectpaint_draw_f(ps, projPixel, texrgb, mask*mixalpha);
+									else do_projectpaint_draw(ps, projPixel, texrgb, mask*mixalpha);
 									break;
 							}
 						}




More information about the Bf-blender-cvs mailing list