Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaia Clary <gaia.clary@machinimatrix.org>2020-01-22 20:00:33 +0300
committerGaia Clary <gaia.clary@machinimatrix.org>2020-01-22 20:04:08 +0300
commit8fc68a2e9cf1d983b3d249988ab05905bd24f06f (patch)
treeae7929ff0ea5aa08b1e71865a1cb576326878e00 /source/blender/collada/collada_utils.cpp
parent084f072aae73de39fecc35ac97d602b1db7d0d98 (diff)
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.
Diffstat (limited to 'source/blender/collada/collada_utils.cpp')
-rw-r--r--source/blender/collada/collada_utils.cpp4
1 files changed, 2 insertions, 2 deletions
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);
}
}