Bugfix - Socket selection status was not updated properly on file load
authorJuho Vepsalainen <bebraw@gmail.com>
Fri, 28 Dec 2007 08:04:37 +0000 (08:04 +0000)
committerJuho Vepsalainen <bebraw@gmail.com>
Fri, 28 Dec 2007 08:04:37 +0000 (08:04 +0000)
This commit adds a missing initialization that caused "Toggle Link (f key)"
not to work properly in case a file with an existing selection status was
opened.

source/blender/blenloader/intern/readfile.c

index 043febbbc75b337e11427416eafe618067d53d6d..a886c0d195b8930b02f162e4254f63837d154c46 100644 (file)
@@ -1524,6 +1524,22 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
                link->tosock= newdataadr(fd, link->tosock);
        }
        
+       /* set selin and selout */
+       for(node= ntree->nodes.first; node; node= node->next) {
+               for(sock= node->inputs.first; sock; sock= sock->next) {
+                       if(sock->flag & SOCK_SEL) {
+                               ntree->selin= sock;
+                               break;
+                       }
+               }
+               for(sock= node->outputs.first; sock; sock= sock->next) {
+                       if(sock->flag & SOCK_SEL) {
+                               ntree->selout= sock;
+                               break;
+                       }
+               }
+       }
+       
        /* type verification is in lib-link */
 }