Fix #31236: linking a socket of a different type to an existing node group output

would crash, did not convert default value storage correctly.
This commit is contained in:
Brecht Van Lommel
2012-05-02 15:47:15 +00:00
parent 1d2e1018f7
commit b2a9d012b4
2 changed files with 4 additions and 2 deletions

View File

@@ -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)) {

View File

@@ -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.