[Bf-blender-cvs] [2f3e398] master: Fix T47729: Linking node sockets using shortcut fails
Julian Eisel
noreply at git.blender.org
Wed Mar 9 11:29:01 CET 2016
Commit: 2f3e39869a6fb8ce9224b83fa1280d9ec1e2fedd
Author: Julian Eisel
Date: Wed Mar 9 11:23:56 2016 +0100
Branches: master
https://developer.blender.org/rB2f3e39869a6fb8ce9224b83fa1280d9ec1e2fedd
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.
===================================================================
M source/blender/editors/space_node/node_relationships.c
===================================================================
diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c
index 50d7df6..d230ebf 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) {
More information about the Bf-blender-cvs
mailing list