Skip to content

Export .ply files from Unity3d editor or runtime. Supports pointclouds and polygonal meshes.

License

Notifications You must be signed in to change notification settings

Macoron/Unity-Ply-Export

Repository files navigation

Unity Ply Export

Export ASCII .ply files from Unity3d editor or runtime.

Supports both pointclouds and polygonal meshes.

Setup

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.

Usages

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.

Limitations

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

License

This project is licensed under the MIT License.

About

Export .ply files from Unity3d editor or runtime. Supports pointclouds and polygonal meshes.

Topics

Resources

License

Stars

Watchers

Forks

Languages