Merge branch 'master' of github.com:tforgione/model-converter

This commit is contained in:
Thomas FORGIONE
2016-12-21 12:17:17 +01:00
4 changed files with 24 additions and 11 deletions

View File

@@ -2,7 +2,6 @@ from ..basemodel import ModelParser, Exporter, Vertex, TexCoord, Normal, FaceVer
from ..mesh import Material, MeshPart
from functools import reduce
import os.path
import PIL.Image
import sys
@@ -90,7 +89,11 @@ class MTLParser:
elif first == 'Ks':
self.current_mtl.Ks = Vertex().from_array(split)
elif first == 'map_Kd':
self.current_mtl.map_Kd = PIL.Image.open(os.path.join(os.path.dirname(self.parent.path), split[0]))
try:
import PIL.Image
self.current_mtl.map_Kd = PIL.Image.open(os.path.join(os.path.dirname(self.parent.path), split[0]))
except:
pass
def parse_file(self, path):