From 7224513f578e3fbc5b10200ea7266054de802da7 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 6 May 2013 14:00:28 +0000 Subject: Fix crash rendering material with "Face Textures" option. Example file: lib/tests/materials/crystal_cube.blend --- source/blender/render/intern/source/imagetexture.c | 4 ++-- source/blender/render/intern/source/render_texture.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index 8bb44918fb6..65976668502 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -224,7 +224,7 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul } /* keep this before interpolation [#29761] */ - if ((tex->imaflag & TEX_USEALPHA) && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) { + if ((tex->imaflag & TEX_USEALPHA) && (ima->flag & IMA_IGNORE_ALPHA) == 0) { if ((tex->imaflag & TEX_CALCALPHA) == 0) { texres->talpha = TRUE; } @@ -1526,7 +1526,7 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const /* mipmap test */ image_mipmap_test(tex, ibuf); - if ((tex->imaflag & TEX_USEALPHA) && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) { + if ((tex->imaflag & TEX_USEALPHA) && (ima->flag & IMA_IGNORE_ALPHA) == 0) { if ((tex->imaflag & TEX_CALCALPHA) == 0) { texres->talpha = TRUE; } diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 48a64822aed..837dfb3d8dd 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -3475,6 +3475,7 @@ void render_realtime_texture(ShadeInput *shi, Image *ima) tex= &imatex[shi->thread]; tex->iuser.ok= ima->ok; + tex->ima = ima; texvec[0]= 0.5f+0.5f*suv->uv[0]; texvec[1]= 0.5f+0.5f*suv->uv[1]; -- cgit v1.2.3