Skip to content

Commit d917e73

Browse files
authored
Merge pull request IfcOpenShell#662 from elmopl/blender_ifc_280rc1
Fix reusing meshes and mesh naming
2 parents 032a474 + 4230797 commit d917e73

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/ifcblender/io_import_scene_ifc/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ def get_collection(cid):
140140
parent_collection.children.link(collection)
141141
collections[cid] = collection
142142

143-
144143
return collection
145144

146145
if process_relations:
@@ -161,7 +160,7 @@ def get_collection(cid):
161160
nm = ob.name if len(ob.name) and use_names else ob.guid
162161
# MESH CREATION
163162
# Depending on version, geometry.id will be either int or str
164-
mesh_name = 'mesh-%r' % ob.geometry.id
163+
mesh_name = f'mesh-{ob.geometry.id}'
165164

166165
me = project_meshes.get(mesh_name)
167166
if me is None:
@@ -171,6 +170,8 @@ def get_collection(cid):
171170
for i in range(0, len(f), 3)]
172171

173172
me = bpy.data.meshes.new(mesh_name)
173+
project_meshes[mesh_name] = me
174+
174175
me.from_pydata(verts, [], faces)
175176
me.validate()
176177
# MATERIAL CREATION

0 commit comments

Comments
 (0)