mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 14:31:39 +00:00
Fix #932 - bug where a material_id of -1 will not import.
This commit is contained in:
@@ -124,7 +124,7 @@ class MaterialCreator():
|
|||||||
material_to_slot[i] = slots.index(material)
|
material_to_slot[i] = slots.index(material)
|
||||||
|
|
||||||
if len(mesh.polygons) == len(mesh['ios_material_ids']):
|
if len(mesh.polygons) == len(mesh['ios_material_ids']):
|
||||||
material_index = [(material_to_slot[mat_id] if mat_id != 999999
|
material_index = [(material_to_slot[mat_id] if mat_id != -1
|
||||||
else 0) for mat_id in mesh['ios_material_ids']]
|
else 0) for mat_id in mesh['ios_material_ids']]
|
||||||
mesh.polygons.foreach_set('material_index', material_index)
|
mesh.polygons.foreach_set('material_index', material_index)
|
||||||
|
|
||||||
@@ -947,8 +947,8 @@ class IfcImporter():
|
|||||||
self.merge_bmeshes(merged_bm, item['blender'])
|
self.merge_bmeshes(merged_bm, item['blender'])
|
||||||
# Magic string NULLMAT represents no material, unless this has a better approach
|
# Magic string NULLMAT represents no material, unless this has a better approach
|
||||||
if materials[i] == 'NULLMAT':
|
if materials[i] == 'NULLMAT':
|
||||||
# Magic number 999999 represents no material, until this has a better approach
|
# Magic number -1 represents no material, until this has a better approach
|
||||||
material_ids += [999999] * total_polygons
|
material_ids += [-1] * total_polygons
|
||||||
else:
|
else:
|
||||||
material_ids += [i] * total_polygons
|
material_ids += [i] * total_polygons
|
||||||
if merged_curve:
|
if merged_curve:
|
||||||
|
|||||||
Reference in New Issue
Block a user