|
|
|
@ -41,7 +41,7 @@ def convert_model(geo_model, mesh_data, obj, scale):
|
|
|
|
|
#Convert the geo_model into a GeoMesh.
|
|
|
|
|
geomesh = geo_model.saveToGeoMesh()
|
|
|
|
|
|
|
|
|
|
indices = [i for face in geomesh.face for i in face.vert_indexes]
|
|
|
|
|
indices = [i for face in geomesh.face for i in (face.vert_indexes[0], face.vert_indexes[2], face.vert_indexes[1])]
|
|
|
|
|
texture_indices = [face.texture_index for face in geomesh.face]
|
|
|
|
|
|
|
|
|
|
#Create materials for textures.
|
|
|
|
@ -89,7 +89,7 @@ def convert_model(geo_model, mesh_data, obj, scale):
|
|
|
|
|
#???mesh_data.validate(False)
|
|
|
|
|
|
|
|
|
|
d = mesh_data.uv_layers.new().data
|
|
|
|
|
uvs = [c for f in geomesh.face for i in f.vert_indexes for c in geomesh.geovertex[i].uv]
|
|
|
|
|
uvs = [c for f in geomesh.face for i in (f.vert_indexes[0], f.vert_indexes[2], f.vert_indexes[1]) for c in geomesh.geovertex[i].uv]
|
|
|
|
|
d.foreach_set('uv', uvs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|