Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Schempp <fabian_schempp>2021-02-11 10:16:17 +0300
committerHans Goudey <h.goudey@me.com>2021-02-11 10:16:17 +0300
commit8f707a72e81833bb835324ddc635b29dfbe87a9f (patch)
tree6628941c09c3a46be9b1c0f36751ed8c6669feee /source/blender/editors/space_node/node_intern.h
parent9a9e19fdcc48622dba8f98c9afb10a6750ff22b0 (diff)
UI: Multi-input node socket spacing and interaction
This commit makes links connected to multi-input sockets spread verticaly along the socket. Sockets grow if more links are connected and the node layout updates accordingly. Links are sorted by their incoming angle to avoid crossing links. Also, link picking is updated to work with spread links and bezier links. Currently the multi-input sockets are used in the join geometry node. The mutli-input sockets look like a vertical rounded rectangle. Currently they do not support the other custom socket shapes. Reviewed By Hans Goudey, with cleanup and additional edits Differential Revision: https://developer.blender.org/D10181
Diffstat (limited to 'source/blender/editors/space_node/node_intern.h')
-rw-r--r--source/blender/editors/space_node/node_intern.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h
index 51333fd5a09..2f3fa6996af 100644
--- a/source/blender/editors/space_node/node_intern.h
+++ b/source/blender/editors/space_node/node_intern.h
@@ -78,6 +78,9 @@ typedef struct SpaceNode_Runtime {
void space_node_group_offset(struct SpaceNode *snode, float *x, float *y);
/* node_draw.c */
+float node_socket_calculate_height(const bNodeSocket *socket);
+void node_link_calculate_multi_input_position(const bNodeLink *link, float r[2]);
+
int node_get_colorid(struct bNode *node);
int node_get_resize_cursor(int directions);
void node_draw_shadow(const struct SpaceNode *snode,
@@ -178,6 +181,10 @@ bool node_link_bezier_points(const struct View2D *v2d,
const struct bNodeLink *link,
float coord_array[][2],
const int resol);
+bool node_link_bezier_handles(const struct View2D *v2d,
+ const struct SpaceNode *snode,
+ const struct bNodeLink *link,
+ float vec[4][2]);
void draw_nodespace_back_pix(const struct bContext *C,
struct ARegion *region,
struct SpaceNode *snode,
@@ -290,6 +297,7 @@ extern const char *node_context_dir[];
#define NODE_HEIGHT(node) (node->height * UI_DPI_FAC)
#define NODE_MARGIN_X (1.10f * U.widget_unit)
#define NODE_SOCKSIZE (0.25f * U.widget_unit)
+#define NODE_MULTI_INPUT_LINK_GAP (0.25f * U.widget_unit)
#define NODE_RESIZE_MARGIN (0.20f * U.widget_unit)
#define NODE_LINK_RESOL 12