Skip to content

Commit d440b7d

Browse files
committed
Fix other index error
Happends for 0 vn or vt index
1 parent 2155e8d commit d440b7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pywavefront/obj.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ def emit_vertex(vertex):
396396
idx = v_index,
397397
pos = self.wavefront.vertices[v_index][0:3] if has_colors else self.wavefront.vertices[v_index],
398398
color = self.wavefront.vertices[v_index][3:] if has_colors else (),
399-
uv = self.tex_coords[t_index] if has_vt else (),
400-
normal = self.normals[n_index] if has_vn else ()
399+
uv = self.tex_coords[t_index] if has_vt and t_index < len(self.tex_coords) else (),
400+
normal = self.normals[n_index] if has_vn and n_index < len(self.normals) else ()
401401
)
402402

403403
yield from emit_vertex(vcurrent)

0 commit comments

Comments
 (0)