From fb738f4929e88b21ebcfb724ae3f460ef6e0f949 Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Fri, 29 Jul 2011 07:14:03 +0000 Subject: When relinking node group outputs from sockets of different type, automatically change the output to the source type. Feature request by Daniel Salazar. --- source/blender/editors/space_node/node_edit.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/editors/space_node/node_edit.c') 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 */ -- cgit v1.2.3