forked from bartvdbraak/blender
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:
parent
f62df587d9
commit
cf83cabb10
@ -2118,9 +2118,9 @@ static void node_remove_extra_links(SpaceNode *snode, bNodeSocket *tsock, bNodeL
|
|||||||
if(tlink) {
|
if(tlink) {
|
||||||
/* try to move the existing link to the next available socket */
|
/* try to move the existing link to the next available socket */
|
||||||
if (tlink->tonode) {
|
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) {
|
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)
|
if(nodeCountSocketLinks(snode->edittree, sock) < sock->limit)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user