|
|
@ -44,6 +44,15 @@ def convert_model(geo_model, mesh_data, obj, scale):
|
|
|
|
indices = [i for face in geomesh.face for i in import_fix_winding(face.vert_indexes)]
|
|
|
|
indices = [i for face in geomesh.face for i in import_fix_winding(face.vert_indexes)]
|
|
|
|
texture_indices = [face.texture_index for face in geomesh.face]
|
|
|
|
texture_indices = [face.texture_index for face in geomesh.face]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Create materials for textures.
|
|
|
|
|
|
|
|
mesh_data.materials.clear()
|
|
|
|
|
|
|
|
#print("geomesh.textures: %s" % (geomesh.textures,))
|
|
|
|
|
|
|
|
for i, tex_name in enumerate(geomesh.textures):
|
|
|
|
|
|
|
|
#if isinstance(tex_name, int):
|
|
|
|
|
|
|
|
# continue
|
|
|
|
|
|
|
|
#print("tex_name: %s" % tex_name)
|
|
|
|
|
|
|
|
mesh_data.materials.append(bpy.data.materials.new(tex_name.decode("utf-8")))
|
|
|
|
|
|
|
|
|
|
|
|
mesh_data.vertices.add(len(geomesh.geovertex))
|
|
|
|
mesh_data.vertices.add(len(geomesh.geovertex))
|
|
|
|
mesh_data.loops.add(len(indices))
|
|
|
|
mesh_data.loops.add(len(indices))
|
|
|
|
mesh_data.polygons.add(len(geomesh.face))
|
|
|
|
mesh_data.polygons.add(len(geomesh.face))
|
|
|
|