Skip to content

Commit eff0935

Browse files
authored
Merge pull request #109 from Lightslayer/master
Force n_index to be parsed when empty string
2 parents 549a5a9 + 6e0e170 commit eff0935

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pywavefront/obj.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,10 @@ def emit_vertex(vertex):
382382
t_index = (int(parts[1]) - 1) if has_vt else None
383383
except ValueError:
384384
t_index = 0
385-
n_index = (int(parts[2]) - 1) if has_vn else None
385+
try:
386+
n_index = (int(parts[2]) - 1) if has_vn else None
387+
except ValueError:
388+
n_index = 0
386389

387390
# Resolve negative index lookups
388391
if v_index < 0:

0 commit comments

Comments
 (0)