Fix: Avoid unnecessary conversions in rotation socket versioning

When the new rotation socket is connected to another rotation socket
already, a conversion node is unnecessary. Check this in addition to the
existing "non-self" implicit conversions.
This commit is contained in:
Hans Goudey
2023-11-22 08:22:50 -05:00
parent 0ff1a8825e
commit 106de9f03c

View File

@@ -1292,8 +1292,9 @@ static void change_input_socket_to_rotation_type(bNodeTree &ntree,
if (link->tosock != &socket) {
continue;
}
if (ELEM(link->fromsock->type, SOCK_VECTOR, SOCK_FLOAT) &&
link->fromnode->type != NODE_REROUTE) {
if (ELEM(link->fromsock->type, SOCK_ROTATION, SOCK_VECTOR, SOCK_FLOAT) &&
link->fromnode->type != NODE_REROUTE)
{
/* No need to add the conversion node when implicit conversions will work. */
continue;
}
@@ -1321,7 +1322,8 @@ static void change_output_socket_to_rotation_type(bNodeTree &ntree,
if (link->fromsock != &socket) {
continue;
}
if (link->tosock->type == SOCK_VECTOR && link->tonode->type != NODE_REROUTE) {
if (ELEM(link->tosock->type, SOCK_ROTATION, SOCK_VECTOR) && link->tonode->type != NODE_REROUTE)
{
/* No need to add the conversion node when implicit conversions will work. */
continue;
}