[Bf-blender-cvs] [e2cefc7dad9] master: fix T61122 : Collada exporter exported alpha value (always 0) from deprecated material attribute

Gaia Clary noreply at git.blender.org
Wed Feb 20 20:47:30 CET 2019


Commit: e2cefc7dad9f254649ed74d32e1ce9875e21b947
Author: Gaia Clary
Date:   Wed Feb 20 20:46:20 2019 +0100
Branches: master
https://developer.blender.org/rBe2cefc7dad9f254649ed74d32e1ce9875e21b947

fix T61122 : Collada exporter exported alpha value (always 0) from deprecated material attribute

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

M	source/blender/collada/EffectExporter.cpp
M	source/blender/collada/collada_utils.cpp

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

diff --git a/source/blender/collada/EffectExporter.cpp b/source/blender/collada/EffectExporter.cpp
index e4a35bcfcd6..b6f8ba9ba1f 100644
--- a/source/blender/collada/EffectExporter.cpp
+++ b/source/blender/collada/EffectExporter.cpp
@@ -98,12 +98,12 @@ void EffectsExporter::set_shader_type(COLLADASW::EffectProfile &ep, Material *ma
 
 void EffectsExporter::set_transparency(COLLADASW::EffectProfile &ep, Material *ma)
 {
-	if (ma->alpha == 1.0f) {
+	if (ma->alpha_threshold == 1.0f) {
 		return; // have no transparency
 	}
 
 	// Tod: because we are in A_ONE mode transparency is calculated like this:
-	COLLADASW::ColorOrTexture cot = getcol(1.0f, 1.0f, 1.0f, ma->alpha);
+	COLLADASW::ColorOrTexture cot = getcol(1.0f, 1.0f, 1.0f, ma->alpha_threshold);
 	ep.setTransparent(cot);
 	ep.setOpaque(COLLADASW::EffectProfile::A_ONE);
 }
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp
index 12eeb73b583..d47ab111487 100644
--- a/source/blender/collada/collada_utils.cpp
+++ b/source/blender/collada/collada_utils.cpp
@@ -1358,7 +1358,7 @@ COLLADASW::ColorOrTexture bc_get_base_color(Material *ma)
 		return bc_get_base_color(master_shader);
 	}
 	else {
-		return bc_get_cot(ma->r, ma->g, ma->b, ma->alpha);
+		return bc_get_cot(ma->r, ma->g, ma->b, ma->alpha_threshold);
 	}
 }



More information about the Bf-blender-cvs mailing list