I found the problem:
it appears that the indices rows are backwards, in the file they look like this
2,1,0,
5,4,3,
8,7,6,
11,10,9,
when they should look like this
0,1,2,
3,4,5,
6,7,8,
9,10,11,
Edit:
Fixed the problem by changing:
fileOut.write("IndexCount{"+str(indices)+"}\n")
fileOut.write("Indices\n{\n")
inc = 0
for i,mesh in enumerate(obj.meshes):
for j in mesh.faces:
inc += 1
x = int(j.indices[0])
y = int(j.indices[1])
z = int(j.indices[2])
v = [x,y,z]
d = str(v).strip("[]")
fileOut.write(d)
if inc*3 == indices:
fileOut.write("\n")
else:
fileOut.write(",\n")
fileOut.write("}\n\n")
in the script to:
fileOut.write("IndexCount{"+str(indices)+"}\n")
fileOut.write("Indices\n{\n")
inc = 0
for i,mesh in enumerate(obj.meshes):
for j in mesh.faces:
inc += 1
x = int(j.indices[2])
y = int(j.indices[1])
z = int(j.indices[0])
v = [x,y,z]
d = str(v).strip("[]")
fileOut.write(d)
if inc*3 == indices:
fileOut.write("\n")
else:
fileOut.write(",\n")
fileOut.write("}\n\n")