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

This commit is contained in:
Gaia Clary 2019-02-20 20:46:20 +01:00
parent 4ec6b16b4e
commit e2cefc7dad
Notes: blender-bot 2023-02-14 06:00:45 +01:00
Referenced by issue #61122, New Materials doesn't appear collada preview
2 changed files with 3 additions and 3 deletions

View File

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

View File

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