From 106de9f03c8dc896e01f2a8a3e68af1cc34d4718 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 22 Nov 2023 08:22:50 -0500 Subject: [PATCH] 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. --- source/blender/blenloader/intern/versioning_400.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/blender/blenloader/intern/versioning_400.cc b/source/blender/blenloader/intern/versioning_400.cc index dba6a3d2506..2fd38cd6067 100644 --- a/source/blender/blenloader/intern/versioning_400.cc +++ b/source/blender/blenloader/intern/versioning_400.cc @@ -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; }