[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36655] branches/particles-2010/source/ blender: Fix for socket verification, this was adding back sockets in reverse order.

Lukas Toenne lukas.toenne at googlemail.com
Fri May 13 07:25:43 CEST 2011


Revision: 36655
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36655
Author:   lukastoenne
Date:     2011-05-13 05:25:43 +0000 (Fri, 13 May 2011)
Log Message:
-----------
Fix for socket verification, this was adding back sockets in reverse order.
Removed some commented debug lines in node sorting.

Modified Paths:
--------------
    branches/particles-2010/source/blender/editors/space_node/node_edit.c
    branches/particles-2010/source/blender/nodes/intern/node_socket.c

Modified: branches/particles-2010/source/blender/editors/space_node/node_edit.c
===================================================================
--- branches/particles-2010/source/blender/editors/space_node/node_edit.c	2011-05-13 04:53:20 UTC (rev 36654)
+++ branches/particles-2010/source/blender/editors/space_node/node_edit.c	2011-05-13 05:25:43 UTC (rev 36655)
@@ -635,16 +635,7 @@
 	int k, a, b;
 	
 	k = 1;
-//	printf(" ----- Merge Sort: ------\n");
 	while (k < totnodes) {
-//		{
-//			bNode *node;
-//			printf("k=%d:\n", k);
-//			for (node=ntree->nodes.first; node; node=node->next) {
-//				printf("\t%s\n", node->name);
-//			}
-//		}
-
 		first_a = first_b = ntree->nodes.first;
 		
 		do {
@@ -655,20 +646,7 @@
 			/* all batches merged? */
 			if (first_b==NULL)
 				break;
-
-//			{
-//				printf("batch:");
-//				if (first_a)
-//					printf("a=%s, ", first_a->name);
-//				else
-//					printf("a=---, ");
-//				if (first_b)
-//					printf("b=%s", first_b->name);
-//				else
-//					printf("b=---");
-//				printf("\n");
-//			}
-
+			
 			/* merge batches */
 			node_a = first_a;
 			node_b = first_b;

Modified: branches/particles-2010/source/blender/nodes/intern/node_socket.c
===================================================================
--- branches/particles-2010/source/blender/nodes/intern/node_socket.c	2011-05-13 04:53:20 UTC (rev 36654)
+++ branches/particles-2010/source/blender/nodes/intern/node_socket.c	2011-05-13 05:25:43 UTC (rev 36655)
@@ -393,11 +393,23 @@
 		
 		/* and we put back the verified sockets */
 		stemp= stemp_first;
-		while(stemp->type != -1) {
-			/* put static sockets infront of dynamic */
-			BLI_addhead(socklist, stemp->sock);
-			stemp++;
+		if (socklist->first) {
+			/* some dynamic sockets left, store the list start
+			 * so we can add static sockets infront of it.
+			 */
+			sock = socklist->first;
+			while(stemp->type != -1) {
+				/* put static sockets infront of dynamic */
+				BLI_insertlinkbefore(socklist, sock, stemp->sock);
+				stemp++;
+			}
 		}
+		else {
+			while(stemp->type != -1) {
+				BLI_addtail(socklist, stemp->sock);
+				stemp++;
+			}
+		}
 	}
 }
 




More information about the Bf-blender-cvs mailing list