[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31426] branches/particles-2010/source/ blender: Fixed bug in adaptable socket propagation, used wrong comparison and didn't include islands of index 0 during merging .

Lukas Toenne lukas.toenne at googlemail.com
Tue Aug 17 19:41:59 CEST 2010


Revision: 31426
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31426
Author:   lukastoenne
Date:     2010-08-17 19:41:59 +0200 (Tue, 17 Aug 2010)

Log Message:
-----------
Fixed bug in adaptable socket propagation, used wrong comparison and didn't include islands of index 0 during merging.

Modified Paths:
--------------
    branches/particles-2010/source/blender/blenkernel/intern/node.c
    branches/particles-2010/source/blender/editors/space_node/node_draw.c

Modified: branches/particles-2010/source/blender/blenkernel/intern/node.c
===================================================================
--- branches/particles-2010/source/blender/blenkernel/intern/node.c	2010-08-17 17:10:56 UTC (rev 31425)
+++ branches/particles-2010/source/blender/blenkernel/intern/node.c	2010-08-17 17:41:59 UTC (rev 31426)
@@ -1786,14 +1786,14 @@
 	int any_island = -1;
 	for (sock=node->inputs.first; sock; sock = sock->next) {
 		if (sock->stype->type == SOCK_ANY) {
-			if (any_island > 0)
+			if (any_island >= 0)
 				merge_socket_islands(islands, any_island, sock->island);
 			any_island = sock->island;
 		}
 	}
 	for (sock=node->outputs.first; sock; sock = sock->next) {
 		if (sock->stype->type == SOCK_ANY) {
-			if (any_island > 0)
+			if (any_island >= 0)
 				merge_socket_islands(islands, any_island, sock->island);
 			any_island = sock->island;
 		}
@@ -1855,7 +1855,6 @@
 	if (!tti->preferredSocketType || !tti->compatibleSocketTypes)
 		return;
 	
-//	ntreeFindSocketIslands(ntree, node_merge_type_islands, link_merge_type, &island_map, &totsock);
 	ntreeInitSocketIslands(ntree, &island_map, &totsock);
 	
 	/* merge islands inside nodes */

Modified: branches/particles-2010/source/blender/editors/space_node/node_draw.c
===================================================================
--- branches/particles-2010/source/blender/editors/space_node/node_draw.c	2010-08-17 17:10:56 UTC (rev 31425)
+++ branches/particles-2010/source/blender/editors/space_node/node_draw.c	2010-08-17 17:41:59 UTC (rev 31426)
@@ -891,11 +891,12 @@
 			#if 1
 			{
 				static char *context_str[] = { "U", "S", "N", "P", "V", "E", "F" };
-				if (node->block) {
-					glColor3ub(220, 220, 30);
-					uiDefBut(node->block, LABEL, 0, context_str[sock->context.type], 
-							 (short)(sock->locx-25), (short)(sock->locy-9.0f), (short)(node->width-NODE_DY), NODE_DY,  NULL, 0, 0, 0, 0, "");
-				}
+				char str[32];
+				uiDefBut(node->block, LABEL, 0, context_str[sock->context.type], 
+						 (short)(sock->locx-25), (short)(sock->locy-9.0f), (short)(node->width-NODE_DY), NODE_DY,  NULL, 0, 0, 0, 0, "");
+				sprintf(str, "%d", sock->island);
+				uiDefBut(node->block, LABEL, 0, str, 
+						 (short)(sock->locx-40), (short)(sock->locy-9.0f), (short)(node->width-NODE_DY), NODE_DY,  NULL, 0, 0, 0, 0, "");
 			}
 			#endif
 		}
@@ -922,9 +923,12 @@
 			#if 1
 			{
 				static char *context_str[] = { "U", "S", "N", "P", "V", "E", "F" };
-				glColor3ub(220, 220, 30);
+				char str[32];
 				uiDefBut(node->block, LABEL, 0, context_str[sock->context.type], (short)(sock->locx+5), (short)(sock->locy-9.0f), 
 						 (short)(node->width-NODE_DY), NODE_DY,  NULL, 0, 0, 0, 0, "");
+				sprintf(str, "%d", sock->island);
+				uiDefBut(node->block, LABEL, 0, str, 
+						 (short)(sock->locx+20), (short)(sock->locy-9.0f), (short)(node->width-NODE_DY), NODE_DY,  NULL, 0, 0, 0, 0, "");
 			}
 			#endif
 		}





More information about the Bf-blender-cvs mailing list