More tests and fixes for linking in models with different project norths

This commit is contained in:
Dion Moult
2024-07-07 23:59:13 +10:00
parent d00e60369b
commit a3844fe098
4 changed files with 83 additions and 12 deletions
+6 -1
View File
@@ -373,7 +373,12 @@ def nothing_happens():
@then(parsers.parse('the object "{name}" exists'))
def the_object_name_exists(name: str) -> bpy.types.Object:
obj = bpy.data.objects.get(name)
# Some objects from linked collections may share the same name. This disambiguates them.
if name.startswith("Col:"):
_, collection_name, name = name.split(":")
obj = bpy.data.collections.get(collection_name).objects.get(name)
else:
obj = bpy.data.objects.get(name)
if not obj:
assert False, f'The object "{name}" does not exist'
return obj