Skip to content

Commit

Permalink
Add check that (loaded) UVs make sense
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanhogg committed Oct 16, 2024
1 parent 3f478c6 commit 63fa3fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/flitter/render/window/models.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ cdef class Model:
buffers = None, None
objects[name] = buffers
return buffers
if (visual := self.trimesh_model.visual) is not None and isinstance(visual, trimesh.visual.texture.TextureVisuals) and visual.uv is not None:
if (visual := self.trimesh_model.visual) is not None and isinstance(visual, trimesh.visual.texture.TextureVisuals) \
and visual.uv is not None and len(visual.uv) == len(self.trimesh_model.vertices):
vertex_uvs = visual.uv
else:
vertex_uvs = np.zeros((len(self.trimesh_model.vertices), 2))
Expand Down

0 comments on commit 63fa3fa

Please sign in to comment.