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:
@@ -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)) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user