mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 14:07:43 +00:00
Small fix for 422f772c4
This commit is contained in:
@@ -402,6 +402,8 @@ class Geometry(blenderbim.core.tool.Geometry):
|
|||||||
return styles
|
return styles
|
||||||
|
|
||||||
usage_count = [0] * len(obj.material_slots)
|
usage_count = [0] * len(obj.material_slots)
|
||||||
|
if not usage_count: # if there are no materials, polygons will still use index 0
|
||||||
|
return []
|
||||||
for poly in obj.data.polygons:
|
for poly in obj.data.polygons:
|
||||||
usage_count[poly.material_index] += 1
|
usage_count[poly.material_index] += 1
|
||||||
styles = [style for style, usage in zip(styles, usage_count, strict=True) if usage > 0]
|
styles = [style for style, usage in zip(styles, usage_count, strict=True) if usage > 0]
|
||||||
|
|||||||
Reference in New Issue
Block a user