[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22671] branches/blender2.5/blender: have texture paint use the curve rather then the falloff setting ( falloff gave ugly center area of 100% opacity)

Campbell Barton ideasman42 at gmail.com
Fri Aug 21 09:19:06 CEST 2009


Revision: 22671
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22671
Author:   campbellbarton
Date:     2009-08-21 09:19:06 +0200 (Fri, 21 Aug 2009)

Log Message:
-----------
have texture paint use the curve rather then the falloff setting (falloff gave ugly center area of 100% opacity)

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/space_view3d_toolbar.py
    branches/blender2.5/blender/source/blender/blenkernel/BKE_brush.h
    branches/blender2.5/blender/source/blender/blenkernel/intern/brush.c
    branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_image.c
    branches/blender2.5/blender/source/blender/windowmanager/intern/Makefile

Modified: branches/blender2.5/blender/release/ui/space_view3d_toolbar.py
===================================================================
--- branches/blender2.5/blender/release/ui/space_view3d_toolbar.py	2009-08-21 06:23:38 UTC (rev 22670)
+++ branches/blender2.5/blender/release/ui/space_view3d_toolbar.py	2009-08-21 07:19:06 UTC (rev 22671)
@@ -378,10 +378,6 @@
 			row.itemR(brush, "strength", slider=True)
 			row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
 			
-			row = col.row(align=True)
-			row.itemR(brush, "falloff", slider=True)
-			row.itemR(brush, "falloff_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
-			
 			col.itemR(brush, "blend")
 		
 		# Weight Paint Mode #

Modified: branches/blender2.5/blender/source/blender/blenkernel/BKE_brush.h
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/BKE_brush.h	2009-08-21 06:23:38 UTC (rev 22670)
+++ branches/blender2.5/blender/source/blender/blenkernel/BKE_brush.h	2009-08-21 07:19:06 UTC (rev 22671)
@@ -64,7 +64,6 @@
 
 /* sampling */
 float brush_sample_falloff(struct Brush *brush, float dist);
-float brush_sample_falloff_noalpha(struct Brush *brush, float dist);
 void brush_sample_tex(struct Brush *brush, float *xy, float *rgba);
 void brush_imbuf_new(struct Brush *brush, short flt, short texfalloff, int size,
 	struct ImBuf **imbuf);

Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/brush.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/brush.c	2009-08-21 06:23:38 UTC (rev 22670)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/brush.c	2009-08-21 07:19:06 UTC (rev 22671)
@@ -409,23 +409,6 @@
 		return 0.0f;
 }
 
-float brush_sample_falloff_noalpha(Brush *brush, float dist)
-{
-	float outer, inner;
-
-	outer = brush->size >> 1;
-	inner = outer*brush->innerradius;
-
-	if (dist <= inner) {
-		return 1.0f;
-	}
-	else if ((dist < outer) && (inner < outer)) {
-		return 1.0f - sqrt((dist - inner)/(outer - inner));
-	}
-	else 
-		return 0.0f;
-}
-
 void brush_sample_tex(Brush *brush, float *xy, float *rgba)
 {
 	MTex *mtex= brush->mtex[brush->texact];

Modified: branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_image.c	2009-08-21 06:23:38 UTC (rev 22670)
+++ branches/blender2.5/blender/source/blender/editors/sculpt_paint/paint_image.c	2009-08-21 07:19:06 UTC (rev 22671)
@@ -3707,7 +3707,7 @@
 	ProjPaintImage *last_projIma= NULL;
 	ImagePaintPartialRedraw *last_partial_redraw_cell;
 	
-	float rgba[4], alpha, dist_nosqrt;
+	float rgba[4], alpha, dist_nosqrt, dist;
 	
 	float brush_size_sqared;
 	float falloff;
@@ -3721,6 +3721,7 @@
 	float co[2];
 	float mask = 1.0f; /* airbrush wont use mask */
 	unsigned short mask_short;
+	float size_half = ((float)ps->brush->size) * 0.5f;
 	
 	LinkNode *smearPixels = NULL;
 	LinkNode *smearPixels_f = NULL;
@@ -3755,8 +3756,8 @@
 			dist_nosqrt = Vec2Lenf_nosqrt(projPixel->projCoSS, pos);
 			
 			/*if (dist < s->brush->size) {*/ /* correct but uses a sqrtf */
-			if (dist_nosqrt < brush_size_sqared) {
-				falloff = brush_sample_falloff_noalpha(ps->brush, sqrtf(dist_nosqrt));
+			if (dist_nosqrt < brush_size_sqared && (dist=sqrtf(dist_nosqrt)) < size_half) {
+				falloff = brush_curve_strength(ps->brush, dist, size_half);
 				if (falloff > 0.0f) {
 					if (ps->is_texbrush) {
 						brush_sample_tex(ps->brush, projPixel->projCoSS, rgba);

Modified: branches/blender2.5/blender/source/blender/windowmanager/intern/Makefile
===================================================================
--- branches/blender2.5/blender/source/blender/windowmanager/intern/Makefile	2009-08-21 06:23:38 UTC (rev 22670)
+++ branches/blender2.5/blender/source/blender/windowmanager/intern/Makefile	2009-08-21 07:19:06 UTC (rev 22671)
@@ -58,7 +58,6 @@
 CPPFLAGS += -I../../blenloader
 CPPFLAGS += -I../../gpu
 CPPFLAGS += -I../../render/extern/include
-CPPFLAGS += -I../../radiosity/extern/include
 CPPFLAGS += -I../../../kernel/gen_system
 CPPFLAGS += -I../../blenfont
 





More information about the Bf-blender-cvs mailing list