Bugfix:
authorTon Roosendaal <ton@blender.org>
Thu, 18 Jan 2007 09:09:16 +0000 (09:09 +0000)
committerTon Roosendaal <ton@blender.org>
Thu, 18 Jan 2007 09:09:16 +0000 (09:09 +0000)
Compositing, depenency fix, so nodes execute only when really changed.
(Error was in nodes that don't get buffers as input, but only values. These
nodes flooded "execute" events through the node tree.)

source/blender/blenkernel/intern/node.c

index 97ab9c03b0dd505c0cef061c6f87c896b77ec598..3d12303e48e328c29c37c129bb7dcf9e5d045fa3 100644 (file)
@@ -2003,11 +2003,23 @@ static void *exec_composite_node(void *node_v)
        return 0;
 }
 
-/* should become a type? these are nodes without input, only giving values */
+/* these are nodes without input, only giving values */
+/* or nodes with only value inputs */
 static int node_only_value(bNode *node)
 {
+       bNodeSocket *sock;
+       
        if(ELEM3(node->type, CMP_NODE_TIME, CMP_NODE_VALUE, CMP_NODE_RGB))
                return 1;
+       
+       if(node->inputs.first) {
+               int retval= 1;
+               for(sock= node->inputs.first; sock; sock= sock->next) {
+                       if(sock->link)
+                               retval &= node_only_value(sock->link->fromnode);
+               }
+               return retval;
+       }
        return 0;
 }
 
@@ -2055,7 +2067,7 @@ static int setExecutableNodes(bNodeTree *ntree, ThreadData *thd)
                                bNodeLink *link= sock->link;
                                /* this is the test for a cyclic case */
                                if(link->fromnode->level >= link->tonode->level && link->tonode->level!=0xFFF) {
-                                       if(sock->link->fromnode->need_exec) {
+                                       if(link->fromnode->need_exec) {
                                                node->need_exec= 1;
                                                break;
                                        }