Merge branch 'master' of github.com:tforgione/model-converter
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -50,13 +50,16 @@ class Material:
|
||||
|
||||
gl.glDisable(gl.GL_TEXTURE_2D)
|
||||
|
||||
import PIL.Image
|
||||
|
||||
Material.DEFAULT_MATERIAL=Material('')
|
||||
Material.DEFAULT_MATERIAL.Ka = 1.0
|
||||
Material.DEFAULT_MATERIAL.Kd = 0.0
|
||||
Material.DEFAULT_MATERIAL.Ks = 0.0
|
||||
Material.DEFAULT_MATERIAL.map_Kd = PIL.Image.new("RGBA", (1,1), "white")
|
||||
|
||||
try:
|
||||
import PIL.Image
|
||||
Material.DEFAULT_MATERIAL.map_Kd = PIL.Image.new("RGBA", (1,1), "white")
|
||||
except:
|
||||
pass
|
||||
|
||||
class MeshPart:
|
||||
def __init__(self, parent):
|
||||
|
||||
Reference in New Issue
Block a user