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:
authorJulian Eisel <eiseljulian@gmail.com>2016-03-09 13:23:56 +0300
committerJulian Eisel <eiseljulian@gmail.com>2016-03-09 13:23:56 +0300
commit2f3e39869a6fb8ce9224b83fa1280d9ec1e2fedd (patch)
treea999dceeb8b69834fc7048e545c79505d1b18619 /source/blender/editors/space_node
parent5704ba7f9bd6ec3525422e6b787c8ea115e17cf5 (diff)
Fix T47729: Linking node sockets using shortcut fails
Could also have swapped nodes to assign instead of swapping after assigning, but this way it's easier to see whats going on.
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r--source/blender/editors/space_node/node_relationships.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c
index 50d7df6ee20..d230ebf546f 100644
--- a/source/blender/editors/space_node/node_relationships.c
+++ b/source/blender/editors/space_node/node_relationships.c
@@ -274,6 +274,10 @@ static void snode_autoconnect(SpaceNode *snode, const bool allow_multiple, const
node_fr = nli->node;
node_to = nli->next->node;
+ /* corner case: input/output node aligned the wrong way around (T47729) */
+ if (BLI_listbase_is_empty(&node_to->inputs) || BLI_listbase_is_empty(&node_fr->outputs)) {
+ SWAP(bNode *, node_fr, node_to);
+ }
/* if there are selected sockets, connect those */
for (sock_to = node_to->inputs.first; sock_to; sock_to = sock_to->next) {