Fix #121110: Allow changing type of reroute node sockets

Simple fix to avoid regression of reroute sockets in a custom nodes system.
Proper solution will be in 4.3: #121146.

Pull Request: https://projects.blender.org/blender/blender/pulls/124244
This commit is contained in:
Iliya Katueshenock 2024-07-05 17:14:54 +02:00 committed by Jacques Lucke
parent e9d46b52df
commit a2a5532818

@ -271,7 +271,11 @@ static void rna_NodeSocket_type_set(PointerRNA *ptr, int value)
blender::bke::nodeFindNode(ntree, sock, &node, nullptr);
if (node->type != NODE_CUSTOM) {
/* Can't change the socket type on built-in nodes like this. */
return;
if (!node->is_reroute()) {
/* TODO: Refactor reroute node to avoid direct change of the socket type in built-in node and
* use proper node method for this. */
return;
}
}
blender::bke::nodeModifySocketTypeStatic(ntree, node, sock, value, 0);
}