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:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-05-15 16:40:43 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-05-15 16:40:43 +0400
commit324b22f701e1b3bc33ed48d30e13b0ca419baa81 (patch)
tree706c3220689d87bf4e5119c816c6d940f8edfa6a /source/blender/editors/space_node/node_draw.c
parent8242f624a1d10649946f9db6994dc8b07a1c8218 (diff)
A generalization of the modal node linking operator (for dragging from socket to socket).
This operator still had some built-in assumptions about the connectivity of input/output sockets (1-to-n in all current node systems). For future node systems (e.g. flow-based particles) and for general customizable nodes the operator is now fully symmetric and supports all kinds of connectivity limits (1:1, 1:n, m:1, m:n). The operator data can also store a list of node links as opposed to a single link now, so that multiple links can be redirected at once. Holding the CTRL key when clicking a socket, all links from/to that socket are detached and can be moved to a different socket. This is useful for quickly appending a node without moving every individual link.
Diffstat (limited to 'source/blender/editors/space_node/node_draw.c')
-rw-r--r--source/blender/editors/space_node/node_draw.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 3a920e16f8a..d93b1b1fcc8 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -914,6 +914,7 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
Scene *scene= CTX_data_scene(C);
int color_manage = scene->r.color_mgt_flag & R_COLOR_MANAGEMENT;
bNodeLinkDrag *nldrag;
+ LinkData *linkdata;
UI_ThemeClearColor(TH_BACK);
glClear(GL_COLOR_BUFFER_BIT);
@@ -965,8 +966,10 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
/* temporary links */
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
- for (nldrag= snode->linkdrag.first; nldrag; nldrag= nldrag->next)
- node_draw_link(&ar->v2d, snode, nldrag->link);
+ for (nldrag= snode->linkdrag.first; nldrag; nldrag= nldrag->next) {
+ for (linkdata=nldrag->links.first; linkdata; linkdata=linkdata->next)
+ node_draw_link(&ar->v2d, snode, (bNodeLink *)linkdata->data);
+ }
glDisable(GL_LINE_SMOOTH);
glDisable(GL_BLEND);