[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55026] trunk/blender/source/blender/ editors/render/render_preview.c: Fix for texture preview render with show alpha enabled, now it shows no

Brecht Van Lommel brechtvanlommel at pandora.be
Mon Mar 4 17:37:05 CET 2013


Revision: 55026
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55026
Author:   blendix
Date:     2013-03-04 16:37:05 +0000 (Mon, 04 Mar 2013)
Log Message:
-----------
Fix for texture preview render with show alpha enabled, now it shows no
transparency when use alpha and calculate alpha are disabled.

It's a bit arbitrary as it's not possible to fully visualize the output
of a texture, that depends on how it's used in the texture stack, but this
is a bit more in line with what you might expect.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/render/render_preview.c

Modified: trunk/blender/source/blender/editors/render/render_preview.c
===================================================================
--- trunk/blender/source/blender/editors/render/render_preview.c	2013-03-04 16:34:37 UTC (rev 55025)
+++ trunk/blender/source/blender/editors/render/render_preview.c	2013-03-04 16:37:05 UTC (rev 55026)
@@ -425,16 +425,17 @@
 						
 						if (tex && sp->slot)
 							mat->mtex[0]->which_output = sp->slot->which_output;
-						
+
+						mat->mtex[0]->mapto &= ~MAP_ALPHA;
+						mat->alpha = 1.0f;
+
 						/* show alpha in this case */
 						if (tex == NULL || (tex->flag & TEX_PRV_ALPHA)) {
-							mat->mtex[0]->mapto |= MAP_ALPHA;
-							mat->alpha = 0.0f;
+							if (!(tex && tex->type == TEX_IMAGE && (tex->imaflag & (TEX_USEALPHA|TEX_CALCALPHA)) == 0)) {
+								mat->mtex[0]->mapto |= MAP_ALPHA;
+								mat->alpha = 0.0f;
+							}
 						}
-						else {
-							mat->mtex[0]->mapto &= ~MAP_ALPHA;
-							mat->alpha = 1.0f;
-						}
 					}
 				}
 			}




More information about the Bf-blender-cvs mailing list