mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 01:47:55 +00:00
Fix #3469. Fix bug where you couldn't load models if there was no style due to no polygons.
This commit is contained in:
@@ -142,11 +142,12 @@ class MaterialCreator:
|
|||||||
if len(self.mesh.materials) == 1:
|
if len(self.mesh.materials) == 1:
|
||||||
return
|
return
|
||||||
material_to_slot = {}
|
material_to_slot = {}
|
||||||
for i, material in enumerate(self.mesh["ios_materials"]):
|
|
||||||
slot_index = self.mesh.materials.find(self.styles[material].name)
|
|
||||||
material_to_slot[i] = slot_index
|
|
||||||
|
|
||||||
if len(self.mesh.polygons) == len(self.mesh["ios_material_ids"]):
|
if len(self.mesh.polygons) == len(self.mesh["ios_material_ids"]):
|
||||||
|
for i, material in enumerate(self.mesh["ios_materials"]):
|
||||||
|
slot_index = self.mesh.materials.find(self.styles[material].name)
|
||||||
|
material_to_slot[i] = slot_index
|
||||||
|
|
||||||
material_index = [
|
material_index = [
|
||||||
(material_to_slot[mat_id] if mat_id != -1 else 0) for mat_id in self.mesh["ios_material_ids"]
|
(material_to_slot[mat_id] if mat_id != -1 else 0) for mat_id in self.mesh["ios_material_ids"]
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user