[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [61185] trunk/blender/source/blender/ editors/space_node/node_relationships.c: Fix for node link highlighting not getting reset if a transform operator is cancelled and the node removed .

Lukas Toenne lukas.toenne at googlemail.com
Thu Nov 7 10:02:30 CET 2013


Revision: 61185
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=61185
Author:   lukastoenne
Date:     2013-11-07 09:02:30 +0000 (Thu, 07 Nov 2013)
Log Message:
-----------
Fix for node link highlighting not getting reset if a transform operator is cancelled and the node removed. Pass the 'test' option in node link insert testing on to the conditions function, so that at least the highlight flags get cleared before exiting the link insert function, even if there is no actual selected node to insert.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_node/node_relationships.c

Modified: trunk/blender/source/blender/editors/space_node/node_relationships.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/node_relationships.c	2013-11-07 09:02:29 UTC (rev 61184)
+++ trunk/blender/source/blender/editors/space_node/node_relationships.c	2013-11-07 09:02:30 UTC (rev 61185)
@@ -1173,7 +1173,7 @@
 
 
 /* prevent duplicate testing code below */
-static bool ed_node_link_conditions(ScrArea *sa, SpaceNode **r_snode, bNode **r_select)
+static bool ed_node_link_conditions(ScrArea *sa, bool test, SpaceNode **r_snode, bNode **r_select)
 {
 	SpaceNode *snode = sa ? sa->spacedata.first : NULL;
 	bNode *node, *select = NULL;
@@ -1186,6 +1186,11 @@
 	if (sa == NULL || sa->spacetype != SPACE_NODE)
 		return false;
 
+	if (!test) {
+		/* no need to look for a node */
+		return true;
+	}
+
 	for (node = snode->edittree->nodes.first; node; node = node->next) {
 		if (node->flag & SELECT) {
 			if (select)
@@ -1223,7 +1228,7 @@
 	bNodeLink *link, *selink = NULL;
 	float mcoords[6][2];
 
-	if (!ed_node_link_conditions(sa, &snode, &select)) return;
+	if (!ed_node_link_conditions(sa, test, &snode, &select)) return;
 
 	/* clear flags */
 	for (link = snode->edittree->links.first; link; link = link->next)
@@ -1302,7 +1307,7 @@
 	bNodeLink *link;
 	bNodeSocket *sockto;
 
-	if (!ed_node_link_conditions(sa, &snode, &select)) return;
+	if (!ed_node_link_conditions(sa, true, &snode, &select)) return;
 
 	/* get the link */
 	for (link = snode->edittree->links.first; link; link = link->next)




More information about the Bf-blender-cvs mailing list