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.
This commit is contained in:
Arystanbek Dyussenov 2010-01-16 15:20:27 +00:00
parent 459f55ed95
commit 7bea39af62
4 changed files with 10 additions and 6 deletions

@ -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

@ -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

@ -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=""

@ -1,5 +1,5 @@
/**
*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*