diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2019-02-23 21:35:31 +0300 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2019-02-23 21:35:31 +0300 |
commit | 5cc0bfa73a7257f3fa44d6894522aad3d81cdeb2 (patch) | |
tree | 0b523a93fb99c51ec008ac304f7f344a95d75e4d | |
parent | 5d822f4508755f90091ea474519bd6001ee8b3a6 (diff) |
fix T61122 : Collada Importer: Added support for transparency for Materials.
This fix sets the Base color in the principled BSDF Shader and in
the Material->r,g,b,a values. So the transparency and color are the
same when switching the "use nodes" option for the material
-rw-r--r-- | source/blender/collada/Materials.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/collada/Materials.cpp b/source/blender/collada/Materials.cpp index a7e9552255a..d6ed0e2859a 100644 --- a/source/blender/collada/Materials.cpp +++ b/source/blender/collada/Materials.cpp @@ -139,15 +139,13 @@ void MaterialNode::set_diffuse(COLLADAFW::ColorOrTexture &cot, std::string label int locy = -300 * (node_map.size()-2); if (cot.isColor()) { COLLADAFW::Color col = cot.getColor(); - material->r = col.getRed(); - material->g = col.getGreen(); - material->b = col.getBlue(); - bNodeSocket *socket = (bNodeSocket *)BLI_findlink(&shader_node->inputs, BC_PBR_DIFFUSE); float *fcol = (float *)socket->default_value; - fcol[0] = col.getRed(); - fcol[1] = col.getGreen(); - fcol[2] = col.getBlue(); + + fcol[0] = material->r = col.getRed(); + fcol[1] = material->g = col.getGreen(); + fcol[2] = material->b = col.getBlue(); + fcol[3] = material->a = col.getAlpha(); } else if (cot.isTexture()) { bNode *texture_node = add_texture_node(cot, -300, locy, label); |