Added group verification after autoconnect to avoid linked+external group sockets.
authorLukas Toenne <lukas.toenne@googlemail.com>
Tue, 18 Jan 2011 14:49:06 +0000 (14:49 +0000)
committerLukas Toenne <lukas.toenne@googlemail.com>
Tue, 18 Jan 2011 14:49:06 +0000 (14:49 +0000)
source/blender/editors/space_node/node_edit.c

index 90e2ef5ebc70703b3e7c104269584c02175b29ba..cf5822d04617d5d61f2cd6b87eb8d3414e5dc01b 100644 (file)
@@ -1407,7 +1407,7 @@ void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace)
        ListBase *nodelist = MEM_callocN(sizeof(ListBase), "items_list");
        bNodeListItem *nli;
        bNode *node;
-       int i;
+       int i, numlinks=0;
        
        for(node= snode->edittree->nodes.first; node; node= node->next) {
                if(node->flag & NODE_SELECT) {
@@ -1445,11 +1445,15 @@ void snode_autoconnect(SpaceNode *snode, int allow_multiple, int replace)
                                nodeRemSocketLinks(snode->edittree, sock_to);
                        nodeAddLink(snode->edittree, node_fr, sock_fr, node_to, sock_to);
                        NodeTagChanged(snode->edittree, node_to);
+                       ++numlinks;
                        break;
                }
        }
        
-       ntreeSolveOrder(snode->edittree);
+       if (numlinks > 0) {
+               node_tree_verify_groups(snode->nodetree);
+               ntreeSolveOrder(snode->edittree);
+       }
        
        BLI_freelistN(nodelist);
        MEM_freeN(nodelist);