diff options
author | Fabian Schempp <fabianschempp@googlemail.com> | 2021-03-10 16:57:57 +0300 |
---|---|---|
committer | Fabian Schempp <fabianschempp@googlemail.com> | 2021-03-10 16:57:57 +0300 |
commit | 576c392241bde1d6497b00490e97e104ac887132 (patch) | |
tree | 97a7455970cb104b5571ed37386ca3fa22dad0ad /source/blender/editors/space_node/drawnode.c | |
parent | 5991c5c9289792e8f9d14375b254ba81306680ac (diff) |
Nodes: Sortable Multi Input Sockets
This Patch removes the auto sorting from Multi-Input Sockets and allows
the links to be sorted by drag and drop instead.
As a minor related change, it fixes the drawing of the mute line to
connect to the first input instead of the socket's center.
Diffstat (limited to 'source/blender/editors/space_node/drawnode.c')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index a9a7ef5a0a2..75ea5b9a1bf 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3593,6 +3593,13 @@ bool node_link_bezier_handles(const View2D *v2d, if (link->fromsock) { vec[0][0] = link->fromsock->locx; vec[0][1] = link->fromsock->locy; + if (link->fromsock->flag & SOCK_MULTI_INPUT) { + node_link_calculate_multi_input_position(link->fromsock->locx, + link->fromsock->locy, + link->fromsock->total_inputs - 1, + link->fromsock->total_inputs, + vec[0]); + } fromreroute = (link->fromnode && link->fromnode->type == NODE_REROUTE); } else { @@ -3606,7 +3613,11 @@ bool node_link_bezier_handles(const View2D *v2d, vec[3][0] = link->tosock->locx; vec[3][1] = link->tosock->locy; if (!(link->tonode->flag & NODE_HIDDEN) && link->tosock->flag & SOCK_MULTI_INPUT) { - node_link_calculate_multi_input_position(link, vec[3]); + node_link_calculate_multi_input_position(link->tosock->locx, + link->tosock->locy, + link->multi_input_socket_index, + link->tosock->total_inputs, + vec[3]); } toreroute = (link->tonode && link->tonode->type == NODE_REROUTE); } |