mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 17:57:02 +00:00
Lazy optimisation to prioritise styledbyitem instead of indexed maps. Allow blank data_index in case we have multiple rep items.
This commit is contained in:
@@ -494,6 +494,10 @@ class Loader(bonsai.core.tool.Loader):
|
|||||||
for item in representation.Items:
|
for item in representation.Items:
|
||||||
if not item.is_a("IfcTessellatedFaceSet"):
|
if not item.is_a("IfcTessellatedFaceSet"):
|
||||||
continue
|
continue
|
||||||
|
# It's unclear what has priority, styled by item or indexed maps
|
||||||
|
# Given that indexed maps currently are super expensive, I'll prioritise styled by item
|
||||||
|
if item.StyledByItem:
|
||||||
|
continue
|
||||||
colours.extend(item.HasColours)
|
colours.extend(item.HasColours)
|
||||||
|
|
||||||
if not colours:
|
if not colours:
|
||||||
@@ -572,7 +576,10 @@ class Loader(bonsai.core.tool.Loader):
|
|||||||
else:
|
else:
|
||||||
data_index = [tex_coord_index - 1 for i in face]
|
data_index = [tex_coord_index - 1 for i in face]
|
||||||
break
|
break
|
||||||
assert data_index is not None
|
|
||||||
|
if data_index is None:
|
||||||
|
# This face may be part of another representation item
|
||||||
|
continue
|
||||||
|
|
||||||
# apply uv to each loop
|
# apply uv to each loop
|
||||||
for loop, i in zip(bface.loops, data_index):
|
for loop, i in zip(bface.loops, data_index):
|
||||||
|
|||||||
Reference in New Issue
Block a user