diff options
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_displace.c | 2 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_util.c | 10 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_util.h | 2 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_warp.c | 2 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_wave.c | 2 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvg_util.c | 5 |
6 files changed, 16 insertions, 7 deletions
diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c index ffd202736a9..b59730d6244 100644 --- a/source/blender/modifiers/intern/MOD_displace.c +++ b/source/blender/modifiers/intern/MOD_displace.c @@ -219,7 +219,7 @@ static void displaceModifier_do( if (dmd->texture) { texres.nor = NULL; - get_texture_value(dmd->texture, tex_co[i], &texres); + get_texture_value(dmd->modifier.scene, dmd->texture, tex_co[i], &texres, false); delta = texres.tin - dmd->midlevel; } else { diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c index c3748ce0265..adbdd9ac2ab 100644 --- a/source/blender/modifiers/intern/MOD_util.c +++ b/source/blender/modifiers/intern/MOD_util.c @@ -50,6 +50,7 @@ #include "BKE_lattice.h" #include "BKE_mesh.h" #include "BKE_displist.h" +#include "BKE_scene.h" #include "BKE_modifier.h" @@ -69,12 +70,17 @@ void modifier_init_texture(Scene *scene, Tex *tex) BKE_image_user_frame_calc(&tex->iuser, scene->r.cfra, 0); } -void get_texture_value(Tex *texture, float *tex_co, TexResult *texres) +void get_texture_value(Scene *scene, Tex *texture, float *tex_co, TexResult *texres, bool use_color_management) { int result_type; + bool do_color_manage = false; + + if (use_color_management) { + do_color_manage = BKE_scene_check_color_management_enabled(scene); + } /* no node textures for now */ - result_type = multitex_ext_safe(texture, tex_co, texres, NULL); + result_type = multitex_ext_safe(texture, tex_co, texres, NULL, do_color_manage); /* if the texture gave an RGB value, we assume it didn't give a valid * intensity, since this is in the context of modifiers don't use perceptual color conversion. diff --git a/source/blender/modifiers/intern/MOD_util.h b/source/blender/modifiers/intern/MOD_util.h index 6f05c9a957a..468e1621d07 100644 --- a/source/blender/modifiers/intern/MOD_util.h +++ b/source/blender/modifiers/intern/MOD_util.h @@ -41,7 +41,7 @@ struct Tex; struct TexResult; void modifier_init_texture(struct Scene *scene, struct Tex *texture); -void get_texture_value(struct Tex *texture, float *tex_co, struct TexResult *texres); +void get_texture_value(struct Scene *scene, struct Tex *texture, float *tex_co, struct TexResult *texres, bool do_color_manage); void get_texture_coords(struct MappingInfoModifierData *dmd, struct Object *ob, struct DerivedMesh *dm, float (*co)[3], float (*texco)[3], int numVerts); void modifier_vgroup_cache(struct ModifierData *md, float (*vertexCos)[3]); diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c index cba1880491c..9acb2f3dc5d 100644 --- a/source/blender/modifiers/intern/MOD_warp.c +++ b/source/blender/modifiers/intern/MOD_warp.c @@ -282,7 +282,7 @@ static void warpModifier_do(WarpModifierData *wmd, Object *ob, if (tex_co) { TexResult texres; texres.nor = NULL; - get_texture_value(wmd->texture, tex_co[i], &texres); + get_texture_value(wmd->modifier.scene, wmd->texture, tex_co[i], &texres, false); fac *= texres.tin; } diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c index 8c6c483472e..71e668a1670 100644 --- a/source/blender/modifiers/intern/MOD_wave.c +++ b/source/blender/modifiers/intern/MOD_wave.c @@ -306,7 +306,7 @@ static void waveModifier_do(WaveModifierData *md, if (wmd->texture) { TexResult texres; texres.nor = NULL; - get_texture_value(wmd->texture, tex_co[i], &texres); + get_texture_value(wmd->modifier.scene, wmd->texture, tex_co[i], &texres, false); amplit *= texres.tin; } 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: |