diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-02 19:47:15 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-02 19:47:15 +0400 |
commit | b2a9d012b4e0ce820cb81ce170d84bed143ac041 (patch) | |
tree | 84bb4469b548206e624497cbadb98a5391312c5f /source | |
parent | 1d2e1018f7babf913d2f6d09f921d3137a8999fa (diff) |
Fix #31236: linking a socket of a different type to an existing node group output
would crash, did not convert default value storage correctly.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 3 | ||||
-rw-r--r-- | source/blender/nodes/intern/node_common.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index c0817f9c895..4bbba419613 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -2412,7 +2412,8 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) /* 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; + if(link->tosock->type != link->fromsock->type) + nodeSocketSetType(link->tosock, link->fromsock->type); } } else if (outside_group_rect(snode) && (link->tonode || link->fromnode)) { diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c index 13882d631d8..3aadcef4c82 100644 --- a/source/blender/nodes/intern/node_common.c +++ b/source/blender/nodes/intern/node_common.c @@ -551,7 +551,8 @@ static bNodeSocket *group_verify_socket(bNodeTree *ntree, ListBase *lb, int in_o sock->groupsock = gsock; BLI_strncpy(sock->name, gsock->name, sizeof(sock->name)); - sock->type= gsock->type; + if(gsock->type != sock->type) + nodeSocketSetType(sock, gsock->type); /* XXX hack: group socket input/output roles are inverted internally, * need to change the limit value when making actual node sockets from them. |