mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-17 02:49:12 +00:00
Fix reusing meshes and mesh naming
This commit is contained in:
committed by
Dion Moult
parent
bd9aa18053
commit
90bf32c342
@@ -140,7 +140,6 @@ def import_ifc(filename, use_names, process_relations, blender_booleans):
|
|||||||
parent_collection.children.link(collection)
|
parent_collection.children.link(collection)
|
||||||
collections[cid] = collection
|
collections[cid] = collection
|
||||||
|
|
||||||
|
|
||||||
return collection
|
return collection
|
||||||
|
|
||||||
if process_relations:
|
if process_relations:
|
||||||
@@ -161,7 +160,7 @@ def import_ifc(filename, use_names, process_relations, blender_booleans):
|
|||||||
nm = ob.name if len(ob.name) and use_names else ob.guid
|
nm = ob.name if len(ob.name) and use_names else ob.guid
|
||||||
# MESH CREATION
|
# MESH CREATION
|
||||||
# Depending on version, geometry.id will be either int or str
|
# Depending on version, geometry.id will be either int or str
|
||||||
mesh_name = 'mesh-%r' % ob.geometry.id
|
mesh_name = f'mesh-{ob.geometry.id}'
|
||||||
|
|
||||||
me = project_meshes.get(mesh_name)
|
me = project_meshes.get(mesh_name)
|
||||||
if me is None:
|
if me is None:
|
||||||
@@ -171,6 +170,8 @@ def import_ifc(filename, use_names, process_relations, blender_booleans):
|
|||||||
for i in range(0, len(f), 3)]
|
for i in range(0, len(f), 3)]
|
||||||
|
|
||||||
me = bpy.data.meshes.new(mesh_name)
|
me = bpy.data.meshes.new(mesh_name)
|
||||||
|
project_meshes[mesh_name] = me
|
||||||
|
|
||||||
me.from_pydata(verts, [], faces)
|
me.from_pydata(verts, [], faces)
|
||||||
me.validate()
|
me.validate()
|
||||||
# MATERIAL CREATION
|
# MATERIAL CREATION
|
||||||
|
|||||||
Reference in New Issue
Block a user