[Bf-blender-cvs] [b679767] master: fix T48857: Improved the handling of Material Alpha, based on patch D1949 with some small modifications

Sandy Carter noreply at git.blender.org
Fri Jul 15 16:15:17 CEST 2016


Commit: b6797676561f63a261f7a69af03cc69500822ec2
Author: Sandy Carter
Date:   Fri Jul 15 16:14:32 2016 +0200
Branches: master
https://developer.blender.org/rBb6797676561f63a261f7a69af03cc69500822ec2

fix T48857: Improved the handling of Material Alpha, based on patch D1949 with some small modifications

===================================================================

M	source/blender/collada/DocumentImporter.cpp

===================================================================

diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index b91039f..226f319 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -924,8 +924,12 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
 	// TRANSPARENT
 	// color
 	if (ef->getOpacity().isColor()) {
-		float alpha = ef->getOpacity().getColor().getAlpha();
-		if (alpha < 1) {
+		col = ef->getTransparent().getColor();
+		float alpha = ef->getTransparency().getFloatValue();
+		if (col.isValid()) {
+			alpha *= col.getAlpha(); // Assuming A_ONE opaque mode
+		}
+		if (col.isValid() || alpha < 1.0) {
 			ma->alpha = alpha;
 			ma->mode |= MA_ZTRANSP | MA_TRANSP;
 		}




More information about the Bf-blender-cvs mailing list