Fix unnecessary mix nodes for Principled BSDF specular tint

If the specular tint is 0 in a 3.6 file, and the base color has a
node input, then don't add a mix node in versioning.

Pull Request: https://projects.blender.org/blender/blender/pulls/113893
This commit is contained in:
Alaska 2023-10-19 13:36:34 +02:00 committed by Brecht Van Lommel
parent c71e18054c
commit 37ab9bb1ed
1 changed files with 2 additions and 2 deletions

View File

@ -849,8 +849,8 @@ static void version_principled_bsdf_specular_tint(bNodeTree *ntree)
static float one[] = {1.0f, 1.0f, 1.0f, 1.0f};
/* If any of the two inputs is dynamic, we add a Mix node. */
if (base_color_sock->link || specular_tint_sock->link) {
/* Add a mix node when working with dynamic inputs. */
if (specular_tint_sock->link || (base_color_sock->link && specular_tint_old != 0)) {
bNode *mix = nodeAddStaticNode(nullptr, ntree, SH_NODE_MIX);
static_cast<NodeShaderMix *>(mix->storage)->data_type = SOCK_RGBA;
mix->locx = node->locx - 170;