if data_chunk1_array[i].data_coding == 0x01c24 then (
for j = 1 to data_chunk1_array[i].element_number do (
offs = ftell f__mesh
x = readshort f__mesh #unsigned
y = readshort f__mesh #unsigned
z = readshort f__mesh #unsigned
fseek f__mesh 0x2 #seek_cur
u = readshort f__mesh #unsigned
w = readshort f__mesh #unsigned
u_f = u
w_f = w
fseek f__mesh 0x10 #seek_cur
append vert_array [x,y,z]
append UV_array [u_f,-w_f+1,0]
--print((j as string)+"||"+((offs) as string) + " || " + ((x) as string) +" "+((y) as string)+" "+((z) as string)+" || "+((u) as string)+" "+((w) as string))
)
)
else if data_chunk1_array[i].data_coding == 0x01c01 then (
for j = 1 to data_chunk1_array[i].element_number do (
offs = ftell f__mesh
x = readshort f__mesh #unsigned
y = readshort f__mesh #unsigned
z = readshort f__mesh #unsigned
fseek f__mesh 0x2 #seek_cur
u = readshort f__mesh #unsigned
w = readshort f__mesh #unsigned
u_f = u
w_f = w
fseek f__mesh 0x10 #seek_cur
append vert_array [x,y,z]
append UV_array [u_f,-w_f+1,0]
--print((j as string)+"||"+((offs) as string) + " || " + ((x) as string) +" "+((y) as string)+" "+((z) as string)+" || "+((u) as string)+" "+((w) as string))
)
)
else if data_chunk1_array[i].data_coding == 0x01802 then (
for j = 1 to data_chunk1_array[i].element_number do (
offs = ftell f__mesh
x = readshort f__mesh #unsigned
y = readshort f__mesh #unsigned
z = readshort f__mesh #unsigned
fseek f__mesh 0x2 #seek_cur
u = readshort f__mesh #unsigned
w = readshort f__mesh #unsigned
u_f = u
w_f = w
fseek f__mesh 0xC #seek_cur
append vert_array [x,y,z]
append UV_array [u_f,-w_f+1,0]
--print((j as string)+"||"+((offs) as string) + " || " + ((x) as string) +" "+((y) as string)+" "+((z) as string)+" || "+((u) as string)+" "+((w) as string))
)
)
else if data_chunk1_array[i].data_coding == 0x02003 then (
for j = 1 to data_chunk1_array[i].element_number do (
offs = ftell f__mesh
x = readshort f__mesh #unsigned
y = readshort f__mesh #unsigned
z = readshort f__mesh #unsigned
fseek f__mesh 0x2 #seek_cur
u = readshort f__mesh #unsigned
w = readshort f__mesh #unsigned
u_f = u
w_f = w
fseek f__mesh 0x14 #seek_cur
append vert_array [x,y,z]
append UV_array [u_f,-w_f+1,0]
--print((j as string)+"||"+((offs) as string) + " || " + ((x) as string) +" "+((y) as string)+" "+((z) as string)+" || "+((u) as string)+" "+((w) as string))
)
)
else if data_chunk1_array[i].data_coding == 0x02025 then (
for j = 1 to data_chunk1_array[i].element_number do (
offs = ftell f__mesh
x = readshort f__mesh #unsigned
y = readshort f__mesh #unsigned
z = readshort f__mesh #unsigned
fseek f__mesh 0x2 #seek_cur
u = readshort f__mesh #unsigned
w = readshort f__mesh #unsigned
u_f = u
w_f = w
fseek f__mesh 0x14 #seek_cur
append vert_array [x,y,z]
append UV_array [u_f,-w_f+1,0]
--print((j as string)+"||"+((offs) as string) + " || " + ((x) as string) +" "+((y) as string)+" "+((z) as string)+" || "+((u) as string)+" "+((w) as string))
)
)
else if data_chunk1_array[i].data_coding == 0x02c2f then (
for j = 1 to data_chunk1_array[i].element_number do (
offs = ftell f__mesh
x = readshort f__mesh #unsigned
y = readshort f__mesh #unsigned
z = readshort f__mesh #unsigned
fseek f__mesh 0x2 #seek_cur
u = readshort f__mesh #unsigned
w = readshort f__mesh #unsigned
u_f = u
w_f = w
fseek f__mesh 0x020 #seek_cur
append vert_array [x,y,z]
append UV_array [u_f,-w_f+1,0]
--print((j as string)+"||"+((offs) as string) + " || " + ((x) as string) +" "+((y) as string)+" "+((z) as string)+" || "+((u) as string)+" "+((w) as string))
)
)
else if data_chunk1_array[i].data_coding == 0x0240e then (
for j = 1 to data_chunk1_array[i].element_number do (
offs = ftell f__mesh
x = readshort f__mesh #unsigned
y = readshort f__mesh #unsigned
z = readshort f__mesh #unsigned
fseek f__mesh 0x2 #seek_cur
u = readshort f__mesh #unsigned
w = readshort f__mesh #unsigned
u_f = u
w_f = w
fseek f__mesh 0x18 #seek_cur
append vert_array [x,y,z]
append UV_array [u_f,-w_f+1,0]
--print((j as string)+"||"+((offs) as string) + " || " + ((x) as string) +" "+((y) as string)+" "+((z) as string)+" || "+((u) as string)+" "+((w) as string))
)
)
else if data_chunk1_array[i].data_coding == 0x02428 then (
for j = 1 to data_chunk1_array[i].element_number do (
offs = ftell f__mesh
x = readshort f__mesh #unsigned
y = readshort f__mesh #unsigned
z = readshort f__mesh #unsigned
fseek f__mesh 0x2 #seek_cur
u = readshort f__mesh #unsigned
w = readshort f__mesh #unsigned
u_f = u
w_f = w
fseek f__mesh 0x18 #seek_cur
append vert_array [x,y,z]
append UV_array [u_f,-w_f+1,0]
--print((j as string)+"||"+((offs) as string) + " || " + ((x) as string) +" "+((y) as string)+" "+((z) as string)+" || "+((u) as string)+" "+((w) as string))
msh = mesh name:((i as string) + "__f" + (face_arrays[i].count as string) + "__v" + (vert_arrays[i].count as string)) vertices:vert_arrays[i] faces:face_arrays[i]
setNumTVerts msh UV_arrays[i].count
for j = 1 to UV_arrays[i].count do (setTVert msh j UV_arrays[i][j])
buildTVFaces msh false
for j = 1 to face_arrays[i].count do (setTVFace msh j face_arrays[i][j])
)
catch(
print("ERROR CREATING MESH " + (i as string) + " number faces: " + (face_arrays[i].count as string) + " number vertex: " + (vert_arrays[i].count as string) + " found vertex: " + (ms[i] as string))