From 63f05576b840c597f91414fd2ca6db8ca869e3e9 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 30 Apr 2013 06:07:42 +0000 Subject: More image painting fixes: * 2D image painting support for masking to limit the max contribution of a stroke to a pixel, to get it working compatible with projection painting. Not strictly a bugfix, but the inconsistency here was annoying. * Fix python errors in Texture Mask panel in image editor, was missing overlay options. * Clamp paint mask to 0..1 in case some texture exceeds it, this could give black pixels due to integer overflow. --- source/blender/blenkernel/intern/brush.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/brush.c') diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 517180964a5..c24aab1629c 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -828,14 +828,15 @@ float BKE_brush_sample_tex_2D(const Scene *scene, Brush *brush, const float xy[2 /* TODO, use define for 'texfall' arg * NOTE: only used for 2d brushes currently! */ -void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texfall, int bufsize, ImBuf **outbuf, int use_color_correction) +void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texfall, int bufsize, + ImBuf **outbuf, bool use_color_correction, bool use_brush_alpha) { ImBuf *ibuf; float xy[2], rgba[4], *dstf; int x, y, rowbytes, xoff, yoff, imbflag; const int radius = BKE_brush_size_get(scene, brush); unsigned char *dst, crgb[3]; - const float alpha = BKE_brush_alpha_get(scene, brush); + const float alpha = (use_brush_alpha)? BKE_brush_alpha_get(scene, brush): 1.0f; float brush_rgb[3]; imbflag = (flt) ? IB_rectfloat : IB_rect; -- cgit v1.2.3