[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39961] trunk/blender/source/blender/nodes /intern/node_socket.c: Fix for #28517, group nodes losing all links from older files.

Lukas Toenne lukas.toenne at googlemail.com
Tue Sep 6 10:28:07 CEST 2011


Revision: 39961
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39961
Author:   lukastoenne
Date:     2011-09-06 08:28:06 +0000 (Tue, 06 Sep 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/nodes/intern/node_socket.c

Modified: trunk/blender/source/blender/nodes/intern/node_socket.c
===================================================================
--- trunk/blender/source/blender/nodes/intern/node_socket.c	2011-09-06 07:59:18 UTC (rev 39960)
+++ trunk/blender/source/blender/nodes/intern/node_socket.c	2011-09-06 08:28:06 UTC (rev 39961)
@@ -422,7 +422,11 @@
 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);
 	}




More information about the Bf-blender-cvs mailing list