Convert meshes to JS format