Skip to content

Commit 1381f6e

Browse files
author
Daniel Coelho
committed
Gracefully throw a warning and carry on if we encounter an unimplemented OBJ statement
1 parent c5cee6e commit 1381f6e

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

pywavefront/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,3 @@ def parse_f(self, args):
147147
if i == 0:
148148
v1 = vertex
149149
vlast = vertex
150-
151-
def parse_s(self, args):
152-
# unimplemented
153-
return

pywavefront/parser.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,11 @@ def parse(self, line, dir):
6363
args[i] = arg
6464
i += 1
6565

66-
parse_function = getattr(self, 'parse_%s' % line_type)
67-
parse_function(args)
66+
attrib = 'parse_%s' % line_type
67+
68+
if hasattr(self, attrib):
69+
parse_function = getattr(self, attrib)
70+
parse_function(args)
71+
else:
72+
print("[PyWavefront] WARNING: Unimplemented OBJ format statement \'%s\' on line \'%s\'"
73+
% (line_type, line.rstrip()))

0 commit comments

Comments
 (0)