This patch adds the ability to export point clouds (loose geometry) via ply.
It would be best to implement this by exporting all loose vertices, if a mesh has a single face - no vertices will be exported.
Also, this patch removes vertex alpha support by accident.
Edit: It might be slow to detect loose vertices, this could be an option.
Thanks for your review @Campbell Barton (campbellbarton) . Good catch, I noticed that it's essentially the same for loose edges.
I've updated the patch to reflect both cases and attached a blend with all possible scenarios I can think of (mesh only, point cloud, mesh with loose edges and vertices etc.).
The exporter is now able to export all components of the geometry. However, I had to re-write the code to maintain the vertex indices for reference. Positive side effect is that in case the mesh has no uv's, the exporter now only writes single vertices an their attributes to the file, instead of writing all vertices per face. In my tests all my scenarios are working and the geometry came back to blender as expected. The importer seems to handle all that cases very great, although we could add removing possible doubles at the end, but I'm not sure whether that's good practice switching to edit mode and so on...
What do you think?
Edit: There are only 3 components per vertex color, right?