X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=blender%2Fio_mspgl%2Fmesh.py;h=754e6ffc2d35460c0e474e7fc02e70b3e62c9568;hp=8f19676ac1127627e2a78771e949d89a9ce5b9c4;hb=8350e7ba2b75f6a5325e7097a3a956661cb4b3b7;hpb=8fe8ab4d4a92520e24a248042c187a8d9778be1f diff --git a/blender/io_mspgl/mesh.py b/blender/io_mspgl/mesh.py index 8f19676a..754e6ffc 100644 --- a/blender/io_mspgl/mesh.py +++ b/blender/io_mspgl/mesh.py @@ -451,10 +451,15 @@ class Mesh: # remains intact for TBN vector computation tbn_layer_index = -1 if self.tbn_vecs: - uv_names = [u.name for u in self.uv_layers] - if self.tbn_uvtex in uv_names: + if self.tbn_uvtex: + uv_names = [u.name for u in self.uv_layers] + if self.tbn_uvtex in uv_names: + tbn_layer_index = uv_names.index(self.tbn_uvtex) + elif self.uv_layers[0].unit==0: + tbn_layer_index = 0 + + if tbn_layer_index>=0: prog_count += 1 - tbn_layer_index = uv_names.index(self.tbn_uvtex) progress.push_task_slice("Computing TBN", 0, prog_count) self.split_vertices(self.find_uv_group, progress, tbn_layer_index) progress.set_task_slice(self.tbn_uvtex, 1, prog_count)