When relinking node group outputs from sockets of different type, automatically chang...
[blender.git] / source / blender / editors / space_node / node_edit.c
index 18d4d85e3ff44487f7139fa9ff5f6cb8e10355aa..c719f7495828e4cc7d7a0bc782e84f7a511d2dcc 100644 (file)
@@ -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 */