Hey thanks for all the help.
Stranger got it (+1).
in the code. There is no point in passing vertices along with Quads and Triangles.
There is, Mesh keeps track of the vertices of the mesh.
Are your lists typified?
vertices = new ArrayList<Transform>();
Then you actually won't need the casts, thanks to ArrayList being generic.
EDIT: hmm, seems like cast is still necessary, my bad, and that code of yours still runs fine, put a print in a finally block and see what just attempted to cast, my guess is some other object got into your list.
Yes they are :
ArrayList<Transform> vertices = new ArrayList<Transform>();
ArrayList<Quad> quads = new ArrayList<Quad>();
ArrayList<Tri> tris = new ArrayList<Tri>();
Sorry for my late reply, and thanks again.