From 09ed97afc5b20767a67d598fa3ede70892b5d647 Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Thu, 25 Oct 2012 16:49:06 +0000 Subject: Internal node links are now cached in a per-node list, instead of being generated as a transient list that is returned from the callback and had to be freed by the caller. These internal links are used for muted nodes, disconnect operators and reroute nodes, to effectively replace the node with direct input-to-output links. Storing this list in the node has the advantage of requiring far fewer calls to the potentially expensive internal_connect callback. This was called on every node redraw ... Also it will allow Cycles to properly use the internal links for muted nodes, which ensures consistent behavior. The previous method was not applicable in Cycles because transient list return values are not supported well in the RNA and particularly the C++ API implementation. --- source/blender/nodes/intern/node_exec.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'source/blender/nodes/intern/node_exec.c') diff --git a/source/blender/nodes/intern/node_exec.c b/source/blender/nodes/intern/node_exec.c index 3040e8589fd..3cc7ebf9337 100644 --- a/source/blender/nodes/intern/node_exec.c +++ b/source/blender/nodes/intern/node_exec.c @@ -177,15 +177,9 @@ bNodeTreeExec *ntree_exec_begin(bNodeTree *ntree) for (sock=node->inputs.first; sock; sock=sock->next) node_init_input_index(sock, &index); - if ((node->flag & NODE_MUTED || node->type == NODE_REROUTE) - && node->typeinfo->internal_connect) { - - ListBase internal_links = node->typeinfo->internal_connect(ntree, node); - + if (node->flag & NODE_MUTED || node->type == NODE_REROUTE) { for (sock=node->outputs.first; sock; sock=sock->next) - node_init_output_index(sock, &index, &internal_links); - - BLI_freelistN(&internal_links); + node_init_output_index(sock, &index, &node->internal_links); } else { for (sock=node->outputs.first; sock; sock=sock->next) -- cgit v1.2.3