[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36518] branches/particles-2010/source/ blender: Renamed the link validity flag and added some comments.

Lukas Toenne lukas.toenne at googlemail.com
Fri May 6 16:59:11 CEST 2011


Revision: 36518
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36518
Author:   lukastoenne
Date:     2011-05-06 14:59:10 +0000 (Fri, 06 May 2011)
Log Message:
-----------
Renamed the link validity flag and added some comments.
Make sure only the node typeinfo flag is read for CONST_OUTPUT and BACKGROUND flags (even though node->flag should not be changed for these).

Modified Paths:
--------------
    branches/particles-2010/source/blender/blenkernel/intern/node.c
    branches/particles-2010/source/blender/editors/space_node/drawnode.c
    branches/particles-2010/source/blender/editors/space_node/node_edit.c
    branches/particles-2010/source/blender/makesdna/DNA_node_types.h
    branches/particles-2010/source/blender/nodes/intern/node_exec.c

Modified: branches/particles-2010/source/blender/blenkernel/intern/node.c
===================================================================
--- branches/particles-2010/source/blender/blenkernel/intern/node.c	2011-05-06 13:33:47 UTC (rev 36517)
+++ branches/particles-2010/source/blender/blenkernel/intern/node.c	2011-05-06 14:59:10 UTC (rev 36518)
@@ -1421,12 +1421,12 @@
 	bNodeLink *link;
 	
 	for (link = ntree->links.first; link; link = link->next) {
-		link->flag |= NLINK_VALID;
+		link->flag |= NODE_LINK_VALID;
 		if (link->fromnode && link->tonode && link->fromnode->level <= link->tonode->level)
-			link->flag &= ~NLINK_VALID;
+			link->flag &= ~NODE_LINK_VALID;
 		else if (ntreetype->validate_link) {
 			if (!ntreetype->validate_link(ntree, link))
-				link->flag &= ~NLINK_VALID;
+				link->flag &= ~NODE_LINK_VALID;
 		}
 	}
 }

Modified: branches/particles-2010/source/blender/editors/space_node/drawnode.c
===================================================================
--- branches/particles-2010/source/blender/editors/space_node/drawnode.c	2011-05-06 13:33:47 UTC (rev 36517)
+++ branches/particles-2010/source/blender/editors/space_node/drawnode.c	2011-05-06 14:59:10 UTC (rev 36518)
@@ -682,7 +682,7 @@
 		draw_value = !(gsock && (gsock->flag & SOCK_INTERNAL));
 		break;
 	case SOCK_OUT:
-		if (gnode->flag & NODE_CONST_OUTPUT)
+		if (gnode->typeinfo->flag & NODE_CONST_OUTPUT)
 			draw_value = !(gsock && gsock->link);
 		else
 			draw_value = 0;
@@ -2517,7 +2517,7 @@
 		}
 		else {
 			/* check cyclic */
-			if((link->fromnode->level >= link->tonode->level && link->tonode->level!=0xFFF) && (link->flag & NLINK_VALID)) {
+			if((link->fromnode->level >= link->tonode->level && link->tonode->level!=0xFFF) && (link->flag & NODE_LINK_VALID)) {
 				if(link->fromnode->flag & SELECT)
 					th_col1= TH_EDGE_SELECT;
 				if(link->tonode->flag & SELECT)

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-06 13:33:47 UTC (rev 36517)
+++ branches/particles-2010/source/blender/editors/space_node/node_edit.c	2011-05-06 14:59:10 UTC (rev 36518)
@@ -614,9 +614,9 @@
 	}
 
 	/* if one of the nodes is in the background and the other not */
-	if ((a->flag & NODE_BACKGROUND) && !(b->flag & NODE_BACKGROUND))
+	if ((a->flag & NODE_BACKGROUND) && !(b->typeinfo->flag & NODE_BACKGROUND))
 		return 0;
-	else if (!(a->flag & NODE_BACKGROUND) && (b->flag & NODE_BACKGROUND))
+	else if (!(a->flag & NODE_BACKGROUND) && (b->typeinfo->flag & NODE_BACKGROUND))
 		return 1;
 	
 	/* if one has a higher selection state (active > selected > nothing) */
@@ -2104,7 +2104,7 @@
 			link = nodeAddLink(snode->edittree, node_fr, sock_fr, node_to, sock_to);
 			/* validate the new link */
 			ntreeUpdateTree(snode->edittree);
-			if (!(link->flag & NLINK_VALID)) {
+			if (!(link->flag & NODE_LINK_VALID)) {
 				nodeRemLink(snode->edittree, link);
 				continue;
 			}

Modified: branches/particles-2010/source/blender/makesdna/DNA_node_types.h
===================================================================
--- branches/particles-2010/source/blender/makesdna/DNA_node_types.h	2011-05-06 13:33:47 UTC (rev 36517)
+++ branches/particles-2010/source/blender/makesdna/DNA_node_types.h	2011-05-06 14:59:10 UTC (rev 36518)
@@ -189,7 +189,8 @@
 	int pad;
 } bNodeLink;
 
-#define NLINK_VALID			1
+/* link->flag */
+#define NODE_LINK_VALID			1		/* link has been successfully validated */
 
 /* the basis for a Node tree, all links and nodes reside internal here */
 /* only re-usable node trees are in the library though, materials and textures allocate own tree struct */
@@ -206,12 +207,8 @@
 									   will increase this counter */
 	int flag;
 	int update;						/* update flags */
-	int pad;
 	
 	int nodetype;					/* specific node type this tree is used for */
-
-	/* only used in local tree copies */
-	int stacksize;
 	
 	ListBase inputs, outputs;		/* external sockets for group nodes */
 	

Modified: branches/particles-2010/source/blender/nodes/intern/node_exec.c
===================================================================
--- branches/particles-2010/source/blender/nodes/intern/node_exec.c	2011-05-06 13:33:47 UTC (rev 36517)
+++ branches/particles-2010/source/blender/nodes/intern/node_exec.c	2011-05-06 14:59:10 UTC (rev 36518)
@@ -198,13 +198,11 @@
 	for(gsock=ntree->outputs.first; gsock; gsock = gsock->next)
 		node_init_input_index(gsock, &index);
 	
-	ntree->stacksize = index;
-	
 	/* allocated exec data pointers for nodes */
 	exec->totnodes = totnodes;
 	exec->nodeexec = MEM_callocN(exec->totnodes * sizeof(bNodeExec), "node execution data");
 	/* allocate data pointer for node stack */
-	exec->stacksize = ntree->stacksize;
+	exec->stacksize = index;
 	exec->stack = MEM_callocN(exec->stacksize * sizeof(bNodeStack), "bNodeStack");
 	
 	/* XXX the input/output tagging could be more precise, but that's also part of the compo redesign */




More information about the Bf-blender-cvs mailing list