Skip to content

Commit ea7d0e6

Browse files
committed
Allow users to override material parser
1 parent 2746c5f commit ea7d0e6

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", parse=True):
1314
"""
@@ -122,7 +123,7 @@ def consume_texture_coordinates(self):
122123
@auto_consume
123124
def parse_mtllib(self):
124125
mtllib = os.path.join(self.dir, " ".join(self.values[1:]))
125-
materials = MaterialParser(mtllib, encoding=self.encoding, strict=self.strict).materials
126+
materials = self.material_parser_cls(mtllib, encoding=self.encoding, strict=self.strict).materials
126127

127128
for name, material in materials.items():
128129
self.wavefront.materials[name] = material

0 commit comments

Comments
 (0)