diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-02-21 21:18:37 +0300 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-02-21 21:18:37 +0300 |
commit | 4fb730d6d0f20db2d35b36237d5778a40bdec076 (patch) | |
tree | a6c92e6f77f19b7cd78e26d40028e80b3672ee3d /source/blender/blenkernel | |
parent | 33887fa41dcc010a8543e8bc78d1b2de23fcd099 (diff) |
Fixed do_versions for node groups which contain nodes that have changed sockets. do_versions is running before the lib_verify_nodetree function updates socket lists of nodes. This means that when adding unlinked sockets in do_versions to restore older node groups, the new sockets are not taken into account. To fix this a temporary node tree flag has been introduced, which delays actual group socket do_version until the group tree internal nodes have been updated. After that the unlinked group sockets are exposed (like old node groups did), then the external sockets look up the new index, so that external links to group instances are preserved.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index cebbab45928..7fd0a2d661a 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -878,14 +878,23 @@ void nodeAddAllGroupSockets(bNodeTree *ngroup) bNode *node; bNodeSocket *sock, *gsock; + printf("Verifying group '%s':\n", ngroup->id.name+2); for (node=ngroup->nodes.first; node; node=node->next) { + printf("\tNode '%s':\n", node->name); for (sock=node->inputs.first; sock; sock=sock->next) { + printf("\t\tInput '%s': link=%p, hidden=%d\n", sock->name, sock->link, (sock->flag & SOCK_HIDDEN)); +// if (sock->link) { +// if (sock->link->fromnode) +// printf("fromnode=%s ", sock->link->fromnode->name); +// printf("fromsock=%s") +// } if (!sock->link && !(sock->flag & SOCK_HIDDEN)) { gsock = nodeAddGroupSocketCopy(ngroup, sock, SOCK_IN); sock->link = nodeAddLink(ngroup, NULL, gsock, node, sock); } } for (sock=node->outputs.first; sock; sock=sock->next) { + printf("\t\tOutput '%s': #links=%d, hidden=%d\n", sock->name, nodeCountSocketLinks(ngroup, sock), (sock->flag & SOCK_HIDDEN)); if (nodeCountSocketLinks(ngroup, sock)==0 && !(sock->flag & SOCK_HIDDEN)) { gsock = nodeAddGroupSocketCopy(ngroup, sock, SOCK_OUT); gsock->link = nodeAddLink(ngroup, node, sock, NULL, gsock); |