[Bf-blender-cvs] [41b33d8] soc-2013-paint: Fix issue with 'swimming' mask textures in 2d painting.

Antony Riakiotakis noreply at git.blender.org
Mon Mar 17 03:19:08 CET 2014


Commit: 41b33d8fe64994f4b5e67bc63322f76e89b99ad7
Author: Antony Riakiotakis
Date:   Mon Mar 17 04:18:34 2014 +0200
https://developer.blender.org/rB41b33d8fe64994f4b5e67bc63322f76e89b99ad7

Fix issue with 'swimming' mask textures in 2d painting.

===================================================================

M	source/blender/editors/sculpt_paint/paint_image_2d.c
M	source/blender/imbuf/intern/rectop.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c
index 5051eb3..25ec043 100644
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@ -683,7 +683,7 @@ static void brush_painter_2d_refresh_cache(ImagePaintState *s, BrushPainter *pai
 		else if (brush->mask_mtex.brush_map_mode == MTEX_MAP_MODE_RANDOM) {
 			renew_maxmask = true;
 		}
-		else {
+		else if (!(brush->flag & BRUSH_ANCHORED)){
 			do_partial_update_mask = true;
 			renew_maxmask = true;
 		}
diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c
index d73ea6e..8bbaaeb 100644
--- a/source/blender/imbuf/intern/rectop.c
+++ b/source/blender/imbuf/intern/rectop.c
@@ -567,10 +567,10 @@ void IMB_rectblend(ImBuf *dbuf, ImBuf *obuf, ImBuf *sbuf, unsigned short *dmask,
 					else {
 						for (x = width; x > 0; x--, dr++, or++, sr++, cmr++) {
 							unsigned char *src = (unsigned char *)sr;
+							unsigned short mask = (((texmaskrect) ? ((float)mask_max * (*tmr++) / 65535.0f) : (float)mask_max) * (*cmr)) / 65535.0f;
 
-							if (src[3] && *cmr) {
+							if (src[3] && *cmr && mask) {
 								unsigned char mask_src[4];
-								unsigned short mask = (((texmaskrect) ? ((float)mask_max * (*tmr++) / 65535.0f) : (float)mask_max) * (*cmr)) / 65535.0f;
 
 								mask_src[0] = src[0];
 								mask_src[1] = src[1];




More information about the Bf-blender-cvs mailing list