for (int j = firstVertex; j < firstVertex + vertexCount; j++) {
Vector3f v = vertices.get(j);
Vector3f vn = normals.isEmpty() ? null : normals.get(j);
Vector2f vt1 = uv1.isEmpty() ? null : uv1.get(j);
Vector2f vt2 = uv2.isEmpty() ? null : uv2.get(j);
Color32 c = colors.isEmpty() ? null : colors.get(j);
writeVertex(v, vn, vt1, vt2, c);
}
// write faces
List<Integer> faceTriangles = new ArrayList<>();