This commit is contained in:
Andrej730
2023-08-23 12:30:13 +05:00
parent a3fd169bb6
commit 6f9da163fb
@@ -402,6 +402,8 @@ class Geometry(blenderbim.core.tool.Geometry):
return styles
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:
usage_count[poly.material_index] += 1
styles = [style for style, usage in zip(styles, usage_count, strict=True) if usage > 0]