diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-05-24 11:35:17 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-05-24 11:35:24 +0300 |
commit | ec5b53a01806465a08ca56a4dcd18092d29d66c3 (patch) | |
tree | a8c08b1e9b46edac1857121ac3c90433215702e8 /source/blender | |
parent | 174c3ffb4adf29e0a7698aacf9468a820f448770 (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')
-rw-r--r-- | source/blender/nodes/shader/node_shader_tree.cc | 7 |
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); |