Chad
unread,Sep 2, 2009, 5:11:52 PM9/2/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to PYGGEL-dev
Hey all,
I just downloaded pyggel and was receiving errors trying to load
an .obj file. I would get the following error:
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/pyggel/mesh.py", line 78, in OBJ
fin.append(i.compile(vertices, normals, texcoords))
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/pyggel/mesh.py", line 107, in compile
ut.append(texcoords[t[i]-1])
IndexError: list index out of range
It looks like 'texcoords' was being used for the face definitions
locally and this was clobbering the version higher up that is meant to
hold the texture coordinates for the entire file. I'm not sure that
makes sense...
Here is a snippet that will fix the issue (~line 54 in mesh.py):
elif values[0] == 'f':
face = []
tcoords = []
norms = []
for v in values[1:]:
w = v.split('/')
face.append(int(w[0]))
if len(w) >= 2 and len(w[1]) > 0:
tcoords.append(int(w[1]))
else:
tcoords.append(0)
if len(w) >= 3 and len(w[2]) > 0:
norms.append(int(w[2]))
else:
norms.append(0)
objs[-1].faces.append((face, norms, tcoords))
Basically, replace 'texcoords' with something else in that elif
clause.
I can provide more detail if you'd like, I just thought I'd mention
this in case no one else had caught it.
Chad