diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-09-06 12:28:06 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-09-06 12:28:06 +0400 |
commit | 82f7a5e3a25492eb58a0c0ec1933309c37d17e28 (patch) | |
tree | 17fe522f8403ae7a7726b9950ab7db18b780a455 | |
parent | c94fe5e2995873536cbdb180652b1aa027e4ef8d (diff) |
Fix for #28517, group nodes losing all links from older files.
The reason was that group nodes tried to reconstruct sockets from the template lists, which are empty. Now the verification function checks if there are any sockets in the template lists, which are always empty for group nodes.
-rw-r--r-- | source/blender/nodes/intern/node_socket.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/nodes/intern/node_socket.c b/source/blender/nodes/intern/node_socket.c index 3ea34dd094a..aabaf5b86de 100644 --- a/source/blender/nodes/intern/node_socket.c +++ b/source/blender/nodes/intern/node_socket.c @@ -422,7 +422,11 @@ static void verify_socket_template_list(bNodeTree *ntree, bNode *node, int in_ou void node_verify_socket_templates(bNodeTree *ntree, bNode *node) { bNodeType *ntype= node->typeinfo; - if(ntype) { + /* XXX Small trick: don't try to match socket lists when there are no templates. + * This also prevents group node sockets from being removed, without the need to explicitly + * check the node type here. + */ + if(ntype && ((ntype->inputs && ntype->inputs[0].type>=0) || (ntype->outputs && ntype->outputs[0].type>=0))) { verify_socket_template_list(ntree, node, SOCK_IN, &node->inputs, ntype->inputs); verify_socket_template_list(ntree, node, SOCK_OUT, &node->outputs, ntype->outputs); } |