Modified behavior when replacing input links: The new target socket for the existing link is now chosen from available sockets that match the _target_ type, instead of the source type. This leads to more usable replacements, e.g. for toggling inputs on mix nodes. Still not a great solution to the mute/autoconnect problem, but a bit more intuitive for replacements.

This commit is contained in:
Lukas Toenne 2011-07-17 19:43:14 +00:00
parent f62df587d9
commit cf83cabb10

@ -2118,9 +2118,9 @@ static void node_remove_extra_links(SpaceNode *snode, bNodeSocket *tsock, bNodeL
if(tlink) {
/* try to move the existing link to the next available socket */
if (tlink->tonode) {
/* is there a free input socket with same type? */
/* is there a free input socket with the target type? */
for(sock= tlink->tonode->inputs.first; sock; sock= sock->next) {
if(sock->type==tlink->fromsock->type)
if(sock->type==tlink->tosock->type)
if(nodeCountSocketLinks(snode->edittree, sock) < sock->limit)
break;
}