Nodes: Add dropdown to select group socket subtype #105614
|
@ -1683,9 +1683,14 @@ void nodeModifySocketType(bNodeTree *ntree,
|
|||
}
|
||||
|
||||
if (sock->default_value) {
|
||||
socket_id_user_decrement(sock);
|
||||
MEM_freeN(sock->default_value);
|
||||
sock->default_value = nullptr;
|
||||
if (sock->type != socktype->type) {
|
||||
/* Only reallocate the default value if the type changed so that UI data like min and max
|
||||
* isn't removed. This assumes that the default value is stored in the same format for all
|
||||
* socket types with the same #eNodeSocketDatatype. */
|
||||
socket_id_user_decrement(sock);
|
||||
MEM_freeN(sock->default_value);
|
||||
sock->default_value = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
BLI_strncpy(sock->idname, idname, sizeof(sock->idname));
|
||||
|
|
Loading…
Reference in New Issue