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:
authorClément Foucault <foucault.clem@gmail.com>2022-05-24 11:35:17 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-05-24 11:35:24 +0300
commitec5b53a01806465a08ca56a4dcd18092d29d66c3 (patch)
treea8c08b1e9b46edac1857121ac3c90433215702e8 /source/blender/nodes
parent174c3ffb4adf29e0a7698aacf9468a820f448770 (diff)
Fix T98247 EEVEE: Regression: Shader To RGB not displaying textures
This was caused by the nodetree branch duplication not handling incoming links to the copied node, making all bsdfs nodes use their default values.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/shader/node_shader_tree.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/nodes/shader/node_shader_tree.cc b/source/blender/nodes/shader/node_shader_tree.cc
index c5f40a46ca3..ec97637ccd2 100644
--- a/source/blender/nodes/shader/node_shader_tree.cc
+++ b/source/blender/nodes/shader/node_shader_tree.cc
@@ -587,10 +587,11 @@ static bNode *ntree_shader_copy_branch(bNodeTree *ntree,
}
}
}
- /* Recreate links between copied nodes. */
+ /* Recreate links between copied nodes AND incomming links to the copied nodes. */
LISTBASE_FOREACH (bNodeLink *, link, &ntree->links) {
- if (link->fromnode->tmp_flag >= 0 && link->tonode->tmp_flag >= 0) {
- bNode *fromnode = nodes_copy[link->fromnode->tmp_flag];
+ if (link->tonode->tmp_flag >= 0) {
+ bool from_node_copied = link->fromnode->tmp_flag >= 0;
+ bNode *fromnode = from_node_copied ? nodes_copy[link->fromnode->tmp_flag] : link->fromnode;
bNode *tonode = nodes_copy[link->tonode->tmp_flag];
bNodeSocket *fromsock = ntree_shader_node_find_output(fromnode, link->fromsock->identifier);
bNodeSocket *tosock = ntree_shader_node_find_input(tonode, link->tosock->identifier);