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/node_intern.h | |
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/node_intern.h')
-rw-r--r-- | source/blender/editors/space_node/node_intern.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index 19700b258ae..241cbee00f0 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -77,6 +77,7 @@ typedef struct SpaceNode_Runtime { /* XXX hack for translate_attach op-macros to pass data from transform op to insert_offset op */ /** Temporary data for node insert offset (in UI called Auto-offset). */ struct NodeInsertOfsData *iofsd; + struct bNode *last_node_hovered_while_dragging_a_link; } SpaceNode_Runtime; /* space_node.c */ @@ -86,7 +87,11 @@ void space_node_group_offset(struct SpaceNode *snode, float *x, float *y); /* node_draw.cc */ float node_socket_calculate_height(const bNodeSocket *socket); -void node_link_calculate_multi_input_position(const bNodeLink *link, float r[2]); +void node_link_calculate_multi_input_position(const float socket_x, + const float socket_y, + const int index, + const int total_inputs, + float r[2]); int node_get_colorid(struct bNode *node); int node_get_resize_cursor(int directions); @@ -215,6 +220,10 @@ void NODE_OT_group_separate(struct wmOperatorType *ot); void NODE_OT_group_edit(struct wmOperatorType *ot); /* node_relationships.c */ +void sort_multi_input_socket_links(struct SpaceNode *snode, + struct bNode *node, + struct bNodeLink *drag_link, + float cursor[2]); bool node_connected_to_output(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node); void NODE_OT_link(struct wmOperatorType *ot); |