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>2012-09-19 19:01:36 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-09-19 19:01:36 +0400
commitd0f4c9639450ec1b90e7041e3d9c30e4927a745d (patch)
tree98c72ca38b3b6f186d04aa3f591b709d45eaed1b /source/blender/editors/sculpt_paint
parent16a698ad4abdcf77b32ec9c797cdb462eec051c4 (diff)
Color Management: don't apply display transform on Non-Color images
Also don't color manage data buffers in texture painting. Makes it possible to view heights and normal maps in proper space and also paint on them without applying extra transformation.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 15593b57aac..a0e3cb1d20f 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -4596,10 +4596,13 @@ static int imapaint_paint_sub_stroke(ImagePaintState *s, BrushPainter *painter,
{
ImBuf *ibuf = BKE_image_get_ibuf(image, s->sima ? &s->sima->iuser : NULL);
float pos[2];
+ int is_data;
if (!ibuf)
return 0;
+ is_data = ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA;
+
pos[0] = uv[0] * ibuf->x;
pos[1] = uv[1] * ibuf->y;
@@ -4608,7 +4611,7 @@ static int imapaint_paint_sub_stroke(ImagePaintState *s, BrushPainter *painter,
/* OCIO_TODO: float buffers are now always linear, so always use color correction
* this should probably be changed when texture painting color space is supported
*/
- if (BKE_brush_painter_paint(painter, imapaint_paint_op, pos, time, pressure, s, TRUE)) {
+ if (BKE_brush_painter_paint(painter, imapaint_paint_op, pos, time, pressure, s, is_data == FALSE)) {
if (update)
imapaint_image_update(s->scene, s->sima, image, ibuf, texpaint);
return 1;