diff options
5 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/nodes/texture/node_texture_tree.c b/source/blender/nodes/texture/node_texture_tree.c index 5e863da9635..7e9360b271c 100644 --- a/source/blender/nodes/texture/node_texture_tree.c +++ b/source/blender/nodes/texture/node_texture_tree.c @@ -318,6 +318,7 @@ int ntreeTexExecTree( data.osatex = osatex; data.target = texres; data.do_preview = preview; + data.do_manage = (shi) ? shi->do_manage : 0; data.thread = thread; data.which_output = which_output; data.cfra = cfra; diff --git a/source/blender/nodes/texture/node_texture_util.c b/source/blender/nodes/texture/node_texture_util.c index a8117b7b333..e01b7ec49f1 100644 --- a/source/blender/nodes/texture/node_texture_util.c +++ b/source/blender/nodes/texture/node_texture_util.c @@ -70,7 +70,7 @@ static void tex_call_delegate(TexDelegate *dg, float *out, TexParams *params, sh dg->fn(out, params, dg->node, dg->in, thread); if (dg->cdata->do_preview) - tex_do_preview(dg->preview, params->previewco, out); + tex_do_preview(dg->preview, params->previewco, out, dg->cdata->do_manage); } } @@ -127,13 +127,13 @@ void params_from_cdata(TexParams *out, TexCallData *in) out->mtex = in->mtex; } -void tex_do_preview(bNodePreview *preview, const float coord[2], const float col[4]) +void tex_do_preview(bNodePreview *preview, const float coord[2], const float col[4], bool do_manage) { if (preview) { int xs = ((coord[0] + 1.0f) * 0.5f) * preview->xsize; int ys = ((coord[1] + 1.0f) * 0.5f) * preview->ysize; - BKE_node_preview_set_pixel(preview, col, xs, ys, 0); /* 0 = no color management */ + BKE_node_preview_set_pixel(preview, col, xs, ys, do_manage); } } diff --git a/source/blender/nodes/texture/node_texture_util.h b/source/blender/nodes/texture/node_texture_util.h index b81ea51ddff..eb81bcd6949 100644 --- a/source/blender/nodes/texture/node_texture_util.h +++ b/source/blender/nodes/texture/node_texture_util.h @@ -84,7 +84,8 @@ typedef struct TexCallData { float *dxt, *dyt; int osatex; - char do_preview; + bool do_preview; + bool do_manage; short thread; short which_output; int cfra; @@ -126,7 +127,7 @@ void tex_input_vec(float *out, bNodeStack *in, TexParams *params, short thread); float tex_input_value(bNodeStack *in, TexParams *params, short thread); void tex_output(bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack *out, TexFn texfn, TexCallData *data); -void tex_do_preview(bNodePreview *preview, const float coord[2], const float col[4]); +void tex_do_preview(bNodePreview *preview, const float coord[2], const float col[4], bool do_manage); void params_from_cdata(TexParams *out, TexCallData *in); diff --git a/source/blender/nodes/texture/nodes/node_texture_output.c b/source/blender/nodes/texture/nodes/node_texture_output.c index 37e527f611a..f93c020b38b 100644 --- a/source/blender/nodes/texture/nodes/node_texture_output.c +++ b/source/blender/nodes/texture/nodes/node_texture_output.c @@ -54,7 +54,7 @@ static void exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *exe tex_input_rgba(&target->tr, in[1], ¶ms, cdata->thread); else tex_input_rgba(&target->tr, in[0], ¶ms, cdata->thread); - tex_do_preview(execdata->preview, params.co, &target->tr); + tex_do_preview(execdata->preview, params.co, &target->tr, cdata->do_manage); } else { /* 0 means don't care, so just use first */ diff --git a/source/blender/nodes/texture/nodes/node_texture_viewer.c b/source/blender/nodes/texture/nodes/node_texture_viewer.c index 5d84a673199..4168e7a16e7 100644 --- a/source/blender/nodes/texture/nodes/node_texture_viewer.c +++ b/source/blender/nodes/texture/nodes/node_texture_viewer.c @@ -52,7 +52,7 @@ static void exec(void *data, int UNUSED(thread), bNode *UNUSED(node), bNodeExecD params_from_cdata(¶ms, cdata); tex_input_rgba(col, in[0], ¶ms, cdata->thread); - tex_do_preview(execdata->preview, params.previewco, col); + tex_do_preview(execdata->preview, params.previewco, col, cdata->do_manage); } } |