diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-10-25 20:49:06 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-10-25 20:49:06 +0400 |
commit | 09ed97afc5b20767a67d598fa3ede70892b5d647 (patch) | |
tree | a15cd34777f011f0c43ed8c2cede6d28a80e0554 /source/blender/blenloader/intern/writefile.c | |
parent | 7107b8eef843a19cabeab1e3d2e68cb3c1cba345 (diff) |
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.
Diffstat (limited to 'source/blender/blenloader/intern/writefile.c')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index a162187e2cd..95886367897 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -720,7 +720,9 @@ static void write_nodetree(WriteData *wd, bNodeTree *ntree) write_node_socket(wd, sock); for (sock= node->outputs.first; sock; sock= sock->next) write_node_socket(wd, sock); - + + for (link = node->internal_links.first; link; link = link->next) + writestruct(wd, DATA, "bNodeLink", 1, link); if (node->storage) { /* could be handlerized at some point, now only 1 exception still */ |