diff options
author | Arystanbek Dyussenov <arystan.d@gmail.com> | 2010-01-16 18:20:27 +0300 |
---|---|---|
committer | Arystanbek Dyussenov <arystan.d@gmail.com> | 2010-01-16 18:20:27 +0300 |
commit | 7bea39af62d8e83c7e375b925b5eee2aee851f66 (patch) | |
tree | c21d249c9b60fce867b0c495a45af94abb15b257 /release | |
parent | 459f55ed9502c435d4f4117b1a053c4c598a016d (diff) |
Workaround to fix #20645. Iteration over multidim arrays and slicing of them is broken.
Before fixing this I'd like to clean BPY a bit.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/io/export_fbx.py | 7 | ||||
-rw-r--r-- | release/scripts/io/export_obj.py | 3 | ||||
-rw-r--r-- | release/scripts/io/export_x3d.py | 4 |
3 files changed, 9 insertions, 5 deletions
diff --git a/release/scripts/io/export_fbx.py b/release/scripts/io/export_fbx.py index a7e126446bd..ffd7c3f3efa 100644 --- a/release/scripts/io/export_fbx.py +++ b/release/scripts/io/export_fbx.py @@ -1751,9 +1751,10 @@ def write(filename, batch_objects = None, \ ii = 0 # Count how many UVs we write for uf in uvlayer.data: -# for f in me.faces: - for uv in uf.uv: -# for uv in f.uv: +# for f in me.faces: + # workaround, since uf.uv iteration is wrong atm + for uv in [uf.uv1, uf.uv2, uf.uv3, uf.uv4][:len(uf.uv)]: +# for uv in f.uv: if i==-1: file.write('%.6f,%.6f' % tuple(uv)) i=0 diff --git a/release/scripts/io/export_obj.py b/release/scripts/io/export_obj.py index 8d1a9a9aced..7c4c83c53c7 100644 --- a/release/scripts/io/export_obj.py +++ b/release/scripts/io/export_obj.py @@ -563,7 +563,8 @@ def write(filename, objects, scene, tface = uv_layer.data[f_index] - uvs = tface.uv + # workaround, since tface.uv iteration is wrong atm + uvs = [tface.uv1, tface.uv2, tface.uv3, tface.uv4][:len(tface.uv)] # uvs = [tface.uv1, tface.uv2, tface.uv3] # # add another UV if it's a quad diff --git a/release/scripts/io/export_x3d.py b/release/scripts/io/export_x3d.py index 6b94a0cc91a..c492c4a6b15 100644 --- a/release/scripts/io/export_x3d.py +++ b/release/scripts/io/export_x3d.py @@ -616,7 +616,8 @@ class x3d_class: for face in mesh.active_uv_texture.data: # for face in mesh.faces: - uvs = face.uv + # workaround, since tface.uv iteration is wrong atm + uvs = [face.uv1, face.uv2, face.uv3, face.uv4][:len(face.uv)] # uvs = [face.uv1, face.uv2, face.uv3, face.uv4] if face.verts[3] else [face.uv1, face.uv2, face.uv3] for uv in uvs: @@ -625,6 +626,7 @@ class x3d_class: texCoordList.append(uv) j=j+1 texIndexList.append(-1) + if self.writingtexture == 0: self.file.write("\n\t\t\ttexCoordIndex=\"") texIndxStr="" |