Fix for bug #8560: grouping nodes could lead to multiple links to the
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sun, 16 Mar 2008 20:49:10 +0000 (20:49 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sun, 16 Mar 2008 20:49:10 +0000 (20:49 +0000)
same input, if the nodes had been grouped separately before.

source/blender/blenkernel/intern/node.c

index 0bec69f2b6f423e890f3bdf48dd3c01e7056df47..1708a12c93bbc263c9214e82b0e10a226c1cf51b 100644 (file)
@@ -534,6 +534,14 @@ bNode *nodeMakeGroupFromSelected(bNodeTree *ntree)
                                        break;
                                }
                        }
+
+                       /* set socket own_index to zero since it can still have a value
+                        * from being in a group before, otherwise it doesn't get a unique
+                        * index in group_verify_own_indices */
+                       for(sock= node->inputs.first; sock; sock= sock->next)
+                               sock->own_index= 0;
+                       for(sock= node->outputs.first; sock; sock= sock->next)
+                               sock->own_index= 0;
                }
        }
 
@@ -589,6 +597,10 @@ bNode *nodeMakeGroupFromSelected(bNodeTree *ntree)
                        }
                }
        }
+
+       /* update node levels */
+       ntreeSolveOrder(ntree);
+
        return gnode;
 }