diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-03-01 20:58:12 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-03-01 20:58:12 +0300 |
commit | 0e8d313f0e92e9b2fed13f5b6a737e8aafcdc25e (patch) | |
tree | 8c58912bd305d340226dca0bb70797e79eff16dc /source/blender/blenkernel | |
parent | f2f52a578a21b0f5e7ec071920effe441c45d021 (diff) |
Fix #26218: texture paint
- Added option "Fixed Texture" to the UI. Because of strange reason,
this feature was implemented but hidden from users.
Would be cool, if somebody familiar with 2d texture paiting check.
- Fixed some issues in existing code of fixed texture paiting.
It now handles brush radius and curve correct.
- Also fixed issue with paiting with texture from node tree - it used
to be painted with regular brush color instead of texture.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index df545741e0e..f4d117d8a07 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -593,7 +593,7 @@ void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf dst[2]= FTOCHAR(rgba[2]); dst[3]= FTOCHAR(rgba[3]); } - else { + else if (texfall == 2) { dist = sqrt(xy[0]*xy[0] + xy[1]*xy[1]); brush_sample_tex(brush, xy, rgba, 0); @@ -601,6 +601,14 @@ void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf dst[1] = FTOCHAR(rgba[1]*brush->rgb[1]); dst[2] = FTOCHAR(rgba[2]*brush->rgb[2]); dst[3] = FTOCHAR(rgba[3]*alpha*brush_curve_strength_clamp(brush, dist, radius)); + } else { + dist = sqrt(xy[0]*xy[0] + xy[1]*xy[1]); + + brush_sample_tex(brush, xy, rgba, 0); + dst[0]= crgb[0]; + dst[1]= crgb[1]; + dst[2]= crgb[2]; + dst[3] = FTOCHAR(rgba[3]*alpha*brush_curve_strength_clamp(brush, dist, radius)); } } } @@ -870,11 +878,8 @@ static void brush_painter_refresh_cache(BrushPainter *painter, float *pos) flt= cache->flt; size= (cache->size)? cache->size: diameter; - if (!(mtex && mtex->tex) || (mtex->tex->type==0)) { - brush_imbuf_new(brush, flt, 0, size, &cache->ibuf); - } - else if (brush->flag & BRUSH_FIXED_TEX) { - brush_imbuf_new(brush, flt, 0, size, &cache->maskibuf); + if (brush->flag & BRUSH_FIXED_TEX) { + brush_imbuf_new(brush, flt, 3, size, &cache->maskibuf); brush_painter_fixed_tex_partial_update(painter, pos); } else |