Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-12-03 20:13:15 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-12-03 20:13:15 +0400
commitd3f3fb89cc2f5745df2b2c1adb0b4db047a3303c (patch)
treef184d8330d2a3d7aebab509832362450dd5e4224 /source/blender/blenkernel/intern/brush.c
parente63d5f23565a4fe426f45fec4152d55a7eafb2d8 (diff)
Fix T37670: Paint mode + procedural map colours error
Summary: Seems to be known TODO in the code, but no idea why it was never solved, especially since tweak is so much easy. It might be arguable that we need to support painting color space, but it's still much better to convert to sRGB space. It's gonna to cover 90% of cases anyway. Reviewers: campbellbarton, brecht Reviewed By: brecht Maniphest Tasks: T37670 Differential Revision: http://developer.blender.org/D65
Diffstat (limited to 'source/blender/blenkernel/intern/brush.c')
-rw-r--r--source/blender/blenkernel/intern/brush.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 33c6f3eb7c0..de81ef179d7 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -45,6 +45,7 @@
#include "BKE_texture.h"
#include "BKE_icons.h"
+#include "IMB_colormanagement.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
@@ -639,6 +640,16 @@ float BKE_brush_sample_tex_3D(const Scene *scene, Brush *br,
rgba[2] = intensity;
rgba[3] = 1.0f;
}
+ else {
+ if (br->mtex.tex->type == TEX_IMAGE && br->mtex.tex->ima) {
+ ImBuf *tex_ibuf = BKE_image_pool_acquire_ibuf(br->mtex.tex->ima, &br->mtex.tex->iuser, pool);
+ /* For consistency, sampling always returns color in linear space */
+ if (tex_ibuf->rect_float == NULL) {
+ IMB_colormanagement_colorspace_to_scene_linear_v3(rgba, tex_ibuf->rect_colorspace);
+ }
+ BKE_image_pool_release_ibuf(br->mtex.tex->ima, tex_ibuf, pool);
+ }
+ }
return intensity;
}