Skip to content

Commit 63fa3fa

Browse files
committed
Add check that (loaded) UVs make sense
1 parent 3f478c6 commit 63fa3fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/flitter/render/window/models.pyx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ cdef class Model:
120120
buffers = None, None
121121
objects[name] = buffers
122122
return buffers
123-
if (visual := self.trimesh_model.visual) is not None and isinstance(visual, trimesh.visual.texture.TextureVisuals) and visual.uv is not None:
123+
if (visual := self.trimesh_model.visual) is not None and isinstance(visual, trimesh.visual.texture.TextureVisuals) \
124+
and visual.uv is not None and len(visual.uv) == len(self.trimesh_model.vertices):
124125
vertex_uvs = visual.uv
125126
else:
126127
vertex_uvs = np.zeros((len(self.trimesh_model.vertices), 2))

0 commit comments

Comments
 (0)