From 1dd7156c4c1d6a62f17fb6621ec3dc31297ba54a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 15 Jul 2013 14:47:58 +0000 Subject: Fix #36058: Displace Modifier errors using a baked Image and displace baking inconsistency between 2.67/2.68RC and previous versions This was in fact really nasty bug, caused by multitex_nodes function using global variable R (which is a copy of current renderer). this variable is not initialized to anything meaningful for until first rendering (preview or final) happened. Since multitex_nodes might be used outside of render pipeline, made it so whether CM is on or off as an argument to functions multitex_ext_safe and multitex_ext. Now multitex_nodes() is only shall be used for stuff happening from render pipeline! Also needed to make some changes to other places, so all the usages of texture sampling knows for the fact whether CM is on or off. And one more change is related on behavior of dispalcement, wave, warp, weightvg modifiers and smoke. They'll be always using CM off since texture is used for influence, not for color. It's rather bigger patch, but it's mostly straightforward changes, which we really need to be done. Reviewed by Brecht, thanks! --- source/blender/modifiers/intern/MOD_weightvg_util.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/modifiers/intern/MOD_weightvg_util.c') diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c index a5e63a7832f..8ad9e26f788 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.c +++ b/source/blender/modifiers/intern/MOD_weightvg_util.c @@ -158,9 +158,12 @@ void weightvg_do_mask(int num, const int *indices, float *org_w, const float *ne int idx = indices ? indices[i] : i; TexResult texres; float hsv[3]; /* For HSV color space. */ + bool do_color_manage; + + do_color_manage = tex_use_channel != MOD_WVG_MASK_TEX_USE_INT; texres.nor = NULL; - get_texture_value(texture, tex_co[idx], &texres); + get_texture_value(scene, texture, tex_co[idx], &texres, do_color_manage); /* Get the good channel value... */ switch (tex_use_channel) { case MOD_WVG_MASK_TEX_USE_INT: -- cgit v1.2.3