[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57123] tags/blender-2.67b-release/blender : svn merge ^/trunk/blender -c56986 -c56989

Campbell Barton ideasman42 at gmail.com
Wed May 29 19:47:44 CEST 2013


Revision: 57123
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57123
Author:   campbellbarton
Date:     2013-05-29 17:47:44 +0000 (Wed, 29 May 2013)
Log Message:
-----------
svn merge ^/trunk/blender -c56986 -c56989

Modified Paths:
--------------
    tags/blender-2.67b-release/blender/source/blender/editors/sculpt_paint/paint_image_proj.c

Property Changed:
----------------
    tags/blender-2.67b-release/blender/


Property changes on: tags/blender-2.67b-release/blender
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573
/trunk/blender:56529-56532,56534,56537-56539,56572,56577,56581,56601,56605-56606,56620,56639,56643,56647-56648,56650-56651,56653-56654,56661-56663,56668,56670-56674,56676,56678-56680,56682,56688-56689,56698,56700,56707,56711,56735,56745,56747-56749,56755-56756,56759-56760,56763,56766-56767,56773,56778,56783-56785,56790-56791,56793,56800,56806-56807,56809,56815-56816,56820,56823,56826,56828,56830,56833-56834,56836,56839,56851,56857,56863,56865,56867-56868,56871-56873,56879-56882,56885,56890,56892,56894,56896-56898,56901-56902,56905-56908,56912,56930,56935,56943,56956-56957,56960,56967-56968,56971,56977,56982,56990-56991,56994,57004,57009,57027,57043,57046,57050,57052,57057,57063-57064,57067-57068,57071-57072,57074,57077,57083,57101,57118
   + /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801,43872,44130,44141,44147-44149,44151-44152,44229-44230,45623-45625,46037,48089,48092,48551-48552,48679,48790,48792-48793,49076,49087,49292,49294,49466,49894,50052,50126,52854-52856,54573
/trunk/blender:56529-56532,56534,56537-56539,56572,56577,56581,56601,56605-56606,56620,56639,56643,56647-56648,56650-56651,56653-56654,56661-56663,56668,56670-56674,56676,56678-56680,56682,56688-56689,56698,56700,56707,56711,56735,56745,56747-56749,56755-56756,56759-56760,56763,56766-56767,56773,56778,56783-56785,56790-56791,56793,56800,56806-56807,56809,56815-56816,56820,56823,56826,56828,56830,56833-56834,56836,56839,56851,56857,56863,56865,56867-56868,56871-56873,56879-56882,56885,56890,56892,56894,56896-56898,56901-56902,56905-56908,56912,56930,56935,56943,56956-56957,56960,56967-56968,56971,56977,56982,56986,56989-56991,56994,57004,57009,57027,57043,57046,57050,57052,57057,57063-57064,57067-57068,57071-57072,57074,57077,57083,57101,57118

Modified: tags/blender-2.67b-release/blender/source/blender/editors/sculpt_paint/paint_image_proj.c
===================================================================
--- tags/blender-2.67b-release/blender/source/blender/editors/sculpt_paint/paint_image_proj.c	2013-05-29 17:43:24 UTC (rev 57122)
+++ tags/blender-2.67b-release/blender/source/blender/editors/sculpt_paint/paint_image_proj.c	2013-05-29 17:47:44 UTC (rev 57123)
@@ -248,7 +248,8 @@
 	short is_ortho;
 	bool do_masking;              /* use masking during painting. Some operations such as airbrush may disable */
 	bool is_texbrush;              /* only to avoid running  */
-	bool is_maskbrush;
+	bool is_maskbrush;            /* mask brush is applied before masking */
+	bool is_maskbrush_tiled;      /* mask brush is applied after masking */
 #ifndef PROJ_DEBUG_NOSEAMBLEED
 	float seam_bleed_px;
 #endif
@@ -3845,7 +3846,14 @@
 							 * and never exceeds it, which gives nice smooth results. */
 							float mask_accum = projPixel->mask_accum;
 
-							mask = mask_accum + (brush_alpha * 65535.0f - mask_accum) * mask;
+							if (ps->is_maskbrush) {
+								float texmask = BKE_brush_sample_masktex(ps->scene, ps->brush, projPixel->projCoSS, thread_index, pool);
+								CLAMP(texmask, 0.0, 1.0);
+								mask = mask_accum + (brush_alpha * texmask * 65535.0f - mask_accum) * mask;
+							}
+							else {
+								mask = mask_accum + (brush_alpha * 65535.0f - mask_accum) * mask;
+							}
 							mask_short = (unsigned short)mask;
 
 							if (mask_short > projPixel->mask_accum) {
@@ -3857,8 +3865,14 @@
 								continue;
 							}
 						}
-						else
+						else {
 							mask *= brush_alpha;
+							if (ps->is_maskbrush) {
+								float texmask = BKE_brush_sample_masktex(ps->scene, ps->brush, projPixel->projCoSS, thread_index, pool);
+								CLAMP(texmask, 0.0, 1.0);
+								mask *= texmask;
+							}
+						}
 
 						if (ps->is_texbrush) {
 							MTex *mtex = &brush->mtex;
@@ -3881,7 +3895,7 @@
 							mask *= texrgba[3];
 						}
 
-						if (ps->is_maskbrush) {
+						if (ps->is_maskbrush_tiled) {
 							mask *= BKE_brush_sample_masktex(ps->scene, ps->brush, projPixel->projCoSS, thread_index, pool);
 						}
 
@@ -4103,13 +4117,23 @@
 		                  (brush->mtex.tex && !ELEM3(brush->mtex.brush_map_mode, MTEX_MAP_MODE_TILED, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_3D)))
 		                 ? false : true;
 		ps->is_texbrush = (brush->mtex.tex && brush->imagepaint_tool == PAINT_TOOL_DRAW) ? true : false;
-		ps->is_maskbrush = (brush->mask_mtex.tex) ? true : false;
+		ps->is_maskbrush = false;
+		ps->is_maskbrush_tiled = false;
+		if (brush->mask_mtex.tex) {
+			if (ELEM(brush->mask_mtex.brush_map_mode, MTEX_MAP_MODE_STENCIL, MTEX_MAP_MODE_TILED)) {
+				ps->is_maskbrush_tiled = true;
+			}
+			else {
+				ps->is_maskbrush = true;
+			}
+		}
 	}
 	else {
 		/* brush may be NULL*/
 		ps->do_masking = false;
 		ps->is_texbrush = false;
 		ps->is_maskbrush = false;
+		ps->is_maskbrush_tiled = false;
 	}
 
 	/* sizeof(ProjPixel), since we alloc this a _lot_ */
@@ -4294,6 +4318,7 @@
 	/* override */
 	ps.is_texbrush = false;
 	ps.is_maskbrush = false;
+	ps.is_maskbrush_tiled = false;
 	ps.do_masking = false;
 	orig_brush_size = BKE_brush_size_get(scene, ps.brush);
 	BKE_brush_size_set(scene, ps.brush, 32); /* cover the whole image */




More information about the Bf-blender-cvs mailing list