fix T61122 : Collada exporter exported alpha value (always 0) from deprecated material attribute
This commit is contained in:
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
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue