[Bf-blender-cvs] [5cc0bfa73a7] master: fix T61122 : Collada Importer: Added support for transparency for Materials.
Gaia Clary
noreply at git.blender.org
Sat Feb 23 19:38:11 CET 2019
Commit: 5cc0bfa73a7257f3fa44d6894522aad3d81cdeb2
Author: Gaia Clary
Date: Sat Feb 23 19:35:31 2019 +0100
Branches: master
https://developer.blender.org/rB5cc0bfa73a7257f3fa44d6894522aad3d81cdeb2
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
===================================================================
M source/blender/collada/Materials.cpp
===================================================================
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);
More information about the Bf-blender-cvs
mailing list