diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-30 14:32:02 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-30 14:32:02 +0400 |
commit | 3b04b861bd964a54ee88defe899978ae564cb037 (patch) | |
tree | 1b30114cefe34686bb870f97eced701c96b381b9 /source/blender/blenkernel/intern/brush.c | |
parent | 9461af89f1da9d4d1f4eef952084bbc7711376d7 (diff) |
Fix another part of #35141: there was no way to reset the stencil transform after e.g.
scaling it along one axis, now there's a Reset Transform button.
The Image Aspect button is now also hidden unless the texture is an image texture.
And also hide the color wheel for painting tools that don't use colors.
Diffstat (limited to 'source/blender/blenkernel/intern/brush.c')
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 41eb641f899..5ddc215dc2c 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -777,7 +777,7 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf const int radius = BKE_brush_size_get(scene, brush); unsigned char *dst, crgb[3]; const float alpha = (use_brush_alpha)? BKE_brush_alpha_get(scene, brush): 1.0f; - float brush_rgb[3]; + float brush_rgb[3] = {1.0f, 1.0f, 1.0f}; int thread = 0; imbflag = (flt) ? IB_rectfloat : IB_rect; @@ -791,9 +791,11 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf ibuf = IMB_allocImBuf(bufsize, bufsize, 32, imbflag); if (flt) { - copy_v3_v3(brush_rgb, brush->rgb); - if (use_color_correction) { - srgb_to_linearrgb_v3_v3(brush_rgb, brush_rgb); + if (brush->imagepaint_tool == PAINT_TOOL_DRAW) { + copy_v3_v3(brush_rgb, brush->rgb); + if (use_color_correction) { + srgb_to_linearrgb_v3_v3(brush_rgb, brush_rgb); + } } for (y = 0; y < ibuf->y; y++) { @@ -834,7 +836,11 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf } else { float alpha_f; /* final float alpha to convert to char */ - rgb_float_to_uchar(crgb, brush->rgb); + + if (brush->imagepaint_tool == PAINT_TOOL_DRAW) + rgb_float_to_uchar(crgb, brush->rgb); + else + rgb_float_to_uchar(crgb, brush_rgb); for (y = 0; y < ibuf->y; y++) { dst = (unsigned char *)ibuf->rect + y * rowbytes; |