mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 21:59:59 +00:00
More tests and fixes for linking in models with different project norths
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user