Fixed missing initialization of node stack entries.
authorLukas Toenne <lukas.toenne@googlemail.com>
Tue, 22 Feb 2011 07:58:49 +0000 (07:58 +0000)
committerLukas Toenne <lukas.toenne@googlemail.com>
Tue, 22 Feb 2011 07:58:49 +0000 (07:58 +0000)
source/blender/blenkernel/intern/node.c

index 7fd0a2d661a39e2bd60366b45954c77d31e2ff48..c614b6910c2463d370c46107641808c49b70e618 100644 (file)
@@ -2195,18 +2195,24 @@ static void group_tag_used_outputs(bNode *gnode, bNodeStack *stack, bNodeStack *
 {
        bNodeTree *ntree= (bNodeTree *)gnode->id;
        bNode *node;
+       bNodeSocket *sock;
        
        stack+= gnode->stack_index;
        
        for(node= ntree->nodes.first; node; node= node->next) {
                if(node->typeinfo->execfunc) {
-                       bNodeSocket *sock;
-                       
                        for(sock= node->inputs.first; sock; sock= sock->next) {
                                bNodeStack *ns = get_socket_stack(stack, sock, gin);
                                ns->hasoutput= 1;
                        }
                }
+               
+               /* set stack types (for local stack entries) */
+               for(sock= node->outputs.first; sock; sock= sock->next) {
+                       bNodeStack *ns = get_socket_stack(stack, sock, NULL);
+                       if (ns)
+                               ns->sockettype = sock->type;
+               }
        }
 }
 
@@ -2313,6 +2319,13 @@ void ntreeBeginExecTree(bNodeTree *ntree)
                                }
                        }
                        
+                       /* set stack types (for local stack entries) */
+                       for(sock= node->outputs.first; sock; sock= sock->next) {
+                               ns = get_socket_stack(ntree->stack, sock, NULL);
+                               if (ns)
+                                       ns->sockettype = sock->type;
+                       }
+                       
                        if(node->type==NODE_GROUP && node->id) {
                                node_get_stack(node, ntree->stack, nsin, NULL, NULL);
                                group_tag_used_outputs(node, ntree->stack, nsin);