have texture paint use the curve rather then the falloff setting (falloff gave ugly...
authorCampbell Barton <ideasman42@gmail.com>
Fri, 21 Aug 2009 07:19:06 +0000 (07:19 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 21 Aug 2009 07:19:06 +0000 (07:19 +0000)
release/ui/space_view3d_toolbar.py
source/blender/blenkernel/BKE_brush.h
source/blender/blenkernel/intern/brush.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/windowmanager/intern/Makefile

index d0f07c70657bd13a00412030c3ea962ed9faa82b..254fb3fd560867ebfe49d59ffce8756f5f20485b 100644 (file)
@@ -378,10 +378,6 @@ class VIEW3D_PT_tools_brush(PaintPanel):
                        row.itemR(brush, "strength", slider=True)
                        row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="")
                        
                        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 #
                        col.itemR(brush, "blend")
                
                # Weight Paint Mode #
index 6ec988e111e2df785fb33a9593bc8ac48980fed6..4d24a2433b3a5f1537de0f49093f49a6fae7b28b 100644 (file)
@@ -64,7 +64,6 @@ float brush_curve_strength(struct Brush *br, float p, const float len);
 
 /* sampling */
 float brush_sample_falloff(struct Brush *brush, float dist);
 
 /* 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);
 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);
index a7b5a16d924a02bc303578c6d1e30bd5c5a8a57b..bce4e1120be5e036755ebbb362973443b89e3cfb 100644 (file)
@@ -409,23 +409,6 @@ float brush_sample_falloff(Brush *brush, float dist)
                return 0.0f;
 }
 
                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];
 void brush_sample_tex(Brush *brush, float *xy, float *rgba)
 {
        MTex *mtex= brush->mtex[brush->texact];
index afd8336c2a9e5f90046070823e4a9f02a346441e..d082e17cda385bd78020e960131aa8f43bdb50d0 100644 (file)
@@ -3707,7 +3707,7 @@ static void *do_projectpaint_thread(void *ph_v)
        ProjPaintImage *last_projIma= NULL;
        ImagePaintPartialRedraw *last_partial_redraw_cell;
        
        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;
        
        float brush_size_sqared;
        float falloff;
@@ -3721,6 +3721,7 @@ static void *do_projectpaint_thread(void *ph_v)
        float co[2];
        float mask = 1.0f; /* airbrush wont use mask */
        unsigned short mask_short;
        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;
        
        LinkNode *smearPixels = NULL;
        LinkNode *smearPixels_f = NULL;
@@ -3755,8 +3756,8 @@ static void *do_projectpaint_thread(void *ph_v)
                        dist_nosqrt = Vec2Lenf_nosqrt(projPixel->projCoSS, pos);
                        
                        /*if (dist < s->brush->size) {*/ /* correct but uses a sqrtf */
                        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);
                                if (falloff > 0.0f) {
                                        if (ps->is_texbrush) {
                                                brush_sample_tex(ps->brush, projPixel->projCoSS, rgba);
index 823423cc28bd5c23d5066a6cbf6232de59da089b..f4d65975d43d831ae6c93aebecb2b05eef39f318 100644 (file)
@@ -58,7 +58,6 @@ CPPFLAGS += -I../../imbuf
 CPPFLAGS += -I../../blenloader
 CPPFLAGS += -I../../gpu
 CPPFLAGS += -I../../render/extern/include
 CPPFLAGS += -I../../blenloader
 CPPFLAGS += -I../../gpu
 CPPFLAGS += -I../../render/extern/include
-CPPFLAGS += -I../../radiosity/extern/include
 CPPFLAGS += -I../../../kernel/gen_system
 CPPFLAGS += -I../../blenfont
 
 CPPFLAGS += -I../../../kernel/gen_system
 CPPFLAGS += -I../../blenfont