From 37ab9bb1ede42779d3d8ab45ca5e568676d0c6bc Mon Sep 17 00:00:00 2001 From: Alaska Date: Thu, 19 Oct 2023 13:36:34 +0200 Subject: [PATCH] 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 --- source/blender/blenloader/intern/versioning_400.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/blenloader/intern/versioning_400.cc b/source/blender/blenloader/intern/versioning_400.cc index 714168670aa..31c1b4b2931 100644 --- a/source/blender/blenloader/intern/versioning_400.cc +++ b/source/blender/blenloader/intern/versioning_400.cc @@ -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(mix->storage)->data_type = SOCK_RGBA; mix->locx = node->locx - 170;