From 8fc68a2e9cf1d983b3d249988ab05905bd24f06f Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Wed, 22 Jan 2020 18:00:33 +0100 Subject: Fix T69090: Collada Exporter now exports the base color if Nodes are disabled I also changed the Collada importer scuh that the diffuse Alpha is now set for the generated PBSDF Shader AND for the base color. Note: we can not export the base color AND the color from the PBSDF Shaders at the same time. And when importing we do not know if the color was originally coming from a base material or from a shader. Setting them both in import seems to give the most consistent results. --- source/blender/collada/collada_utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/collada/collada_utils.cpp') diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp index 6116b04e122..d5011581204 100644 --- a/source/blender/collada/collada_utils.cpp +++ b/source/blender/collada/collada_utils.cpp @@ -1321,7 +1321,7 @@ void bc_add_default_shader(bContext *C, Material *ma) COLLADASW::ColorOrTexture bc_get_base_color(Material *ma) { - Color default_color = {0.8, 0.8, 0.8, 1.0}; + Color default_color = {ma->r, ma->g, ma->b, 1.0}; // for alpha see bc_get_alpha() bNode *shader = bc_get_master_shader(ma); if (ma->use_nodes && shader) { return bc_get_cot_from_shader(shader, "Base Color", default_color, false); @@ -1424,7 +1424,7 @@ COLLADASW::ColorOrTexture bc_get_cot_from_shader(bNode *shader, return bc_get_cot(col, with_alpha); } else { - return bc_get_cot(default_color, with_alpha); /* default black */ + return bc_get_cot(default_color, with_alpha); } } -- cgit v1.2.3