[Bf-blender-cvs] [aebcb3b] master: Tweak for node socket swapping: don't un-hide sockets automatically.

Lukas Tönne noreply at git.blender.org
Tue May 13 07:50:31 CEST 2014


Commit: aebcb3bab9679bbcfd6b881fdd1f42b8708450db
Author: Lukas Tönne
Date:   Tue May 13 07:41:48 2014 +0200
https://developer.blender.org/rBaebcb3bab9679bbcfd6b881fdd1f42b8708450db

Tweak for node socket swapping: don't un-hide sockets automatically.

This was suggested by @zanqdo on IRC. Hiding sockets is a user choice
(not to be confused with "unavailable" disabled sockets). Hidden sockets
suddenly popping up when linking is confusing and intransparent, better
just ignore them for the swapping.

===================================================================

M	source/blender/editors/space_node/node_relationships.c

===================================================================

diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c
index 6a0e1f3..97a2383 100644
--- a/source/blender/editors/space_node/node_relationships.c
+++ b/source/blender/editors/space_node/node_relationships.c
@@ -461,7 +461,7 @@ static bNodeSocket *node_find_linkable_socket(bNodeTree *ntree, bNode *node, bNo
 		
 		sock = cur->next ? cur->next : first; /* wrap around the list end */
 		while (sock != cur) {
-			if (node_link_socket_match(sock, cur)) {
+			if (!nodeSocketIsHidden(sock) && node_link_socket_match(sock, cur)) {
 				int link_count = node_count_links(ntree, sock);
 				/* take +1 into account since we would add a new link */
 				if (link_count + 1 <= sock->limit)
@@ -490,7 +490,6 @@ static void node_remove_extra_links(SpaceNode *snode, bNodeLink *link, bool use_
 			if (new_from && new_from != from) {
 				/* redirect existing link */
 				tlink->fromsock = new_from;
-				new_from->flag &= ~SOCK_HIDDEN;
 			}
 			else if (!new_from) {
 				/* no possible replacement, remove tlink */
@@ -504,7 +503,6 @@ static void node_remove_extra_links(SpaceNode *snode, bNodeLink *link, bool use_
 			if (new_to && new_to != to) {
 				/* redirect existing link */
 				tlink->tosock = new_to;
-				new_to->flag &= ~SOCK_HIDDEN;
 			}
 			else if (!new_to) {
 				/* no possible replacement, remove tlink */




More information about the Bf-blender-cvs mailing list