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

This commit is contained in:
Sandy Carter 2016-07-15 16:14:32 +02:00 committed by Gaia Clary
parent 27641b51e7
commit b679767656
Notes: blender-bot 2023-02-14 07:45:34 +01:00
Referenced by issue #48857, Support Transparency
1 changed files with 6 additions and 2 deletions

View File

@ -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;
}