Fix #151531: Copying node tree interface items between interfaces

If the item to be copied is not within the target interface tree, this PR now
adds the item to the end of the interface instead of performing a NOOP.

Co-authored-by: Lukas Tönne <lukas@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/151567
This commit is contained in:
Natalie Cuthbert 2026-01-23 13:03:48 +01:00 • committed by Lukas Tönne
parent ee3291ec0a
commit 9c67e1e656
3 changed files with 28 additions and 5 deletions

View file

@ -209,6 +209,12 @@ class NodeGroupInterfaceTests:
if (hasattr(in1, "default_value")):
self.do_test_user_count(in1.default_value, 4)
tree2 = self.make_group()
inCrossTreeCopy = tree2.interface.copy(in0)
outCrossTreeCopy = tree2.interface.copy(out1)
self.assertIsNotNone(inCrossTreeCopy, "Could not copy socket to other tree")
self.assertIsNotNone(outCrossTreeCopy, "Could not copy socket to other tree")
# Classic outputs..inputs socket layout
def do_test_items_order_classic(self, socket_type):
tree, group_node = self.make_group_and_instance()