https://github.com/macoron/unity-ply-export
Export .ply files from Unity3d editor or runtime. Supports pointclouds and polygonal meshes.
https://github.com/macoron/unity-ply-export
ply unity
Last synced: about 1 year ago
JSON representation
Export .ply files from Unity3d editor or runtime. Supports pointclouds and polygonal meshes.
- Host: GitHub
- URL: https://github.com/macoron/unity-ply-export
- Owner: Macoron
- License: mit
- Created: 2022-06-18T18:39:36.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-18T22:48:24.000Z (about 4 years ago)
- Last Synced: 2025-03-27T05:13:05.102Z (about 1 year ago)
- Topics: ply, unity
- Language: C#
- Homepage:
- Size: 7.81 KB
- Stars: 9
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Unity Ply Export
Export ASCII [.ply files](https://en.wikipedia.org/wiki/PLY_(file_format)) 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:
```csharp
var meshFilter = GetComponent();
var ply = PlyExport.ToPly(meshFilter);
File.WriteAllText("mesh.ply", ply);
```
Export pointcloud into .ply file:
```csharp
var points = new List();
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:
- [x] Colored pointclouds
- [x] Polygonal mesh
- [x] Mesh vertex colors
- [ ] Mesh vertex normals
- [ ] Mesh materials
- [ ] Mesh UV
## License
This project is licensed under the MIT License.