Export ASCII .ply files from Unity3d editor or runtime.
Supports both pointclouds and polygonal meshes.
You can install this package using Package Manager. Add it by this git URL:
https://github.com/Macoron/Unity-Ply-Export.git
Alternatively just clone this repo and place files somewhere in your Assets folder.
Export mesh model into .ply file:
var meshFilter = GetComponent<MeshFilter>();
var ply = PlyExport.ToPly(meshFilter);
File.WriteAllText("mesh.ply", ply);
Export pointcloud into .ply file:
var points = new List<Vector3>();
for (int i = 0; i < 1000; i++)
points.Add(Random.insideUnitSphere);
var ply = PlyExport.ToPlyPointcloud(points.ToArray());
File.WriteAllText("pointcloud.ply", ply);
You can also export selected meshes in Editor by clicking menu Assets => Export selected to .ply
.
Keep in mind that not all data is supported for export:
- Colored pointclouds
- Polygonal mesh
- Mesh vertex colors
- Mesh vertex normals
- Mesh materials
- Mesh UV
This project is licensed under the MIT License.