Skip to content

Commit a4b1d94

Browse files
author
Kurt Yoder
authored
Merge pull request #54 from einarf/mat-parser
Allow users to override material parser
2 parents bb0d5e6 + 56ec49d commit a4b1d94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pywavefront/obj.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
class ObjParser(Parser):
1010
"""This parser parses lines from .obj files."""
11+
material_parser_cls = MaterialParser
1112

1213
def __init__(self, wavefront, file_name, strict=False, encoding="utf-8", create_materials=False, parse=True):
1314
"""
@@ -125,7 +126,7 @@ def consume_texture_coordinates(self):
125126
def parse_mtllib(self):
126127
mtllib = os.path.join(self.dir, " ".join(self.values[1:]))
127128
try:
128-
materials = MaterialParser(mtllib, encoding=self.encoding, strict=self.strict).materials
129+
materials = self.material_parser_cls(mtllib, encoding=self.encoding, strict=self.strict).materials
129130
except IOError:
130131
if self.create_materials:
131132
return

0 commit comments

Comments
 (0)