Fix T87171: Update multi input socket indices
When inserting a node on top of a link, the multi input socket indices weren't updated. This fixes that and keeps the relative order of the links the same. Author: Wannes Malfait Reviewed By: Fabian Schempp Differential Revision: https://developer.blender.org/D10969
This commit is contained in:
Submodule release/scripts/addons_contrib updated: 5523cbaed6...2ffe34eb02
@@ -2260,7 +2260,12 @@ void ED_node_link_insert(Main *bmain, ScrArea *area)
|
||||
node_remove_extra_links(snode, link);
|
||||
link->flag &= ~NODE_LINKFLAG_HILITE;
|
||||
|
||||
nodeAddLink(snode->edittree, select, best_output, node, sockto);
|
||||
bNodeLink *new_link = nodeAddLink(snode->edittree, select, best_output, node, sockto);
|
||||
|
||||
/* Copy the socket index for the new link, and reset it for the old link. This way the
|
||||
* relative order of links is preserved, and the links get drawn in the right place. */
|
||||
new_link->multi_input_socket_index = link->multi_input_socket_index;
|
||||
link->multi_input_socket_index = 0;
|
||||
|
||||
/* set up insert offset data, it needs stuff from here */
|
||||
if ((snode->flag & SNODE_SKIP_INSOFFSET) == 0) {
|
||||
@@ -2277,8 +2282,6 @@ void ED_node_link_insert(Main *bmain, ScrArea *area)
|
||||
snode_update(snode, select);
|
||||
ED_node_tag_update_id((ID *)snode->edittree);
|
||||
ED_node_tag_update_id(snode->id);
|
||||
|
||||
sort_multi_input_socket_links(snode, node, NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Submodule source/tools updated: f1db70de64...f99d29ae3e
Reference in New Issue
Block a user