diff --git a/wfobj.py b/wfobj.py index b2154fb..df5079c 100755 --- a/wfobj.py +++ b/wfobj.py @@ -29,7 +29,7 @@ class WFObj(object): def add_face(*vrefs): def split_vref(vref): - parts = map(int, vref.split('/')) + parts = map(lambda x: 0 if x == '' else int(x), vref.split('/')) while len(parts) < 3: parts.append(0) return parts @@ -133,6 +133,7 @@ class WFObj(object): material = self.Material() material_name = parts[1] self.materials[material_name] = material + continue else: if material is None: raise ValueError('Material directive preceeding "newmtl" on line %d' % lineno)