fix [#29761] Texture painting with interpolation ignores use alpha
authorCampbell Barton <ideasman42@gmail.com>
Tue, 3 Jan 2012 02:26:32 +0000 (02:26 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 3 Jan 2012 02:26:32 +0000 (02:26 +0000)
reporter - Shawn Zilbert (enigmatic) included patch.

source/blender/render/intern/source/imagetexture.c

index 785d9ac..0b6e1b8 100644 (file)
@@ -203,6 +203,13 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
                ibuf->rect+= (ibuf->x*ibuf->y);
        }
 
+       /* keep this before interpolation [#29761] */
+       if (tex->imaflag & TEX_USEALPHA) {
+               if ((tex->imaflag & TEX_CALCALPHA) == 0) {
+                       texres->talpha = TRUE;
+               } 
+       }
+
        /* interpolate */
        if (tex->imaflag & TEX_INTERPOL) {
                float filterx, filtery;
@@ -225,11 +232,6 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
                ibuf->rect-= (ibuf->x*ibuf->y);
        }
 
-       if(tex->imaflag & TEX_USEALPHA) {
-               if(tex->imaflag & TEX_CALCALPHA);
-               else texres->talpha= 1;
-       }
-       
        if(texres->nor) {
                if(tex->imaflag & TEX_NORMALMAP) {
                        // qdn: normal from color