diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-02-10 18:16:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-02-10 18:16:30 +0400 |
commit | 0ee8c1bb2001c7b7dd2e20a2e2e871fad62477c8 (patch) | |
tree | 50ff9ccbb31a2d24499e557751d1393006b6ff3e /io_scene_obj | |
parent | 9fa784d80a8a4483a159dad665b8f704bc30f605 (diff) |
fix for UV export
Diffstat (limited to 'io_scene_obj')
-rw-r--r-- | io_scene_obj/export_obj.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/io_scene_obj/export_obj.py b/io_scene_obj/export_obj.py index e57d852c..21e20db6 100644 --- a/io_scene_obj/export_obj.py +++ b/io_scene_obj/export_obj.py @@ -447,23 +447,25 @@ def write_file(filepath, objects, scene, # in case removing some of these dont get defined. uv = uvkey = uv_dict = f_index = uv_index = None - uv_face_mapping = [[0] * a[0].loop_total for i, a in enumerate(face_index_pairs)] + uv_face_mapping = [None] * len(face_index_pairs) uv_dict = {} # could use a set() here for f, f_index in face_index_pairs: + uv_ls = uv_face_mapping[f_index] = [] for uv_index, l_index in enumerate(f.loop_indices): uv = uv_layer[l_index].uv uvkey = veckey2d(uv) try: - uv_face_mapping[f_index][uv_index] = uv_dict[uvkey] + uv_k = uv_dict[uvkey] except: - uv_face_mapping[f_index][uv_index] = uv_dict[uvkey] = len(uv_dict) + uv_k = uv_dict[uvkey] = len(uv_dict) fw('vt %.6f %.6f\n' % uv[:]) + uv_ls.append(uv_k) uv_unique_count = len(uv_dict) - del uv, uvkey, uv_dict, f_index, uv_index + del uv, uvkey, uv_dict, f_index, uv_index, uv_ls, uv_k # Only need uv_unique_count and uv_face_mapping # NORMAL, Smooth/Non smoothed. |