diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-07-29 11:14:03 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-07-29 11:14:03 +0400 |
commit | fb738f4929e88b21ebcfb724ae3f460ef6e0f949 (patch) | |
tree | 6629b2174f7b850a6775d4de02546e47ae07bf81 /source/blender | |
parent | 26589497529ca3c8da85391d4976d286a371e258 (diff) |
When relinking node group outputs from sockets of different type, automatically change the output to the source type. Feature request by Daniel Salazar.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 18d4d85e3ff..c719f749582 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -2216,6 +2216,12 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) /* we might need to remove a link */ if(in_out==SOCK_OUT) node_remove_extra_links(snode, link->tosock, link); + + /* when linking to group outputs, update the socket type */ + /* XXX this should all be part of a generic update system */ + if (!link->tonode) { + link->tosock->type = link->fromsock->type; + } } else if (outside_group_rect(snode) && (link->tonode || link->fromnode)) { /* automatically add new group socket */ |