Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sandrofigo/VoxReader
A C# library to read .vox files created with MagicaVoxel
https://github.com/sandrofigo/VoxReader
magica-voxel magicavoxel openupm parser parser-library reader unity unity-3d unity-scripts unity3d unity3d-plugin vox vox-files voxel
Last synced: 2 months ago
JSON representation
A C# library to read .vox files created with MagicaVoxel
- Host: GitHub
- URL: https://github.com/sandrofigo/VoxReader
- Owner: sandrofigo
- License: mit
- Created: 2019-09-08T10:25:07.000Z (over 5 years ago)
- Default Branch: develop
- Last Pushed: 2023-05-20T14:53:16.000Z (over 1 year ago)
- Last Synced: 2024-10-30T00:04:35.738Z (3 months ago)
- Topics: magica-voxel, magicavoxel, openupm, parser, parser-library, reader, unity, unity-3d, unity-scripts, unity3d, unity3d-plugin, vox, vox-files, voxel
- Language: C#
- Homepage:
- Size: 183 KB
- Stars: 63
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-unity3d - VoxReader - Library to read .vox files created with MagicaVoxel. (Open Source Repositories / Meshes)
- awesome-unity-open-source-on-github - VoxReader - Library to read .vox files created with MagicaVoxel (Voxel)
README
# VoxReader
[![latest](https://img.shields.io/nuget/v/VoxReader)](https://www.nuget.org/packages/VoxReader/)
[![openupm](https://img.shields.io/npm/v/com.sandrofigo.voxreader?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.sandrofigo.voxreader/)
[![downloads](https://img.shields.io/nuget/dt/VoxReader?color=blue)](https://www.nuget.org/packages/VoxReader/)
[![build](https://github.com/sandrofigo/VoxReader/actions/workflows/build.yml/badge.svg)](https://github.com/sandrofigo/VoxReader/actions/workflows/build.yml)A C# library to read .vox files created with [MagicaVoxel](https://ephtracy.github.io/index.html?page=mv_main)
---
## Currently supported features
At the moment it is possible to read:
- the name, size and position of all models
- all individual voxels including their color and position
- the palette that was used for the model
- the notes stored in the palette
- all raw data related to the scene
- miscellaneous raw data## Usage
```csharp
// Read .vox file
IVoxFile voxFile = VoxReader.Read("my_awesome_model.vox");// Access models of .vox file
IModel[] models = voxFile.Models;// Access voxels of first model in the file
Voxel[] voxels = models[0].Voxels;// Access properties of a voxel
Vector3 position = voxels[0].Position;
Color color = voxels[0].Color;// Access palette of .vox file
IPalette palette = voxFile.Palette;// Access raw data of a chunk
byte[] rawData = voxFile.Chunks[0].Content;
```## Unity
The package is also available on [OpenUPM](https://openupm.com/packages/com.sandrofigo.voxreader/) for the Unity game engine.
Follow the [manual installation](https://openupm.com/packages/com.sandrofigo.voxreader/?subPage=readme#modal-manualinstallation) or the [CLI installation](https://openupm.com/packages/com.sandrofigo.voxreader/?subPage=readme#modal-commandlinetool) instructions on the OpenUPM page to install the package in your project.## Extending the library
The file format specification made by [ephtracy](https://github.com/ephtracy) is available at [.vox file format](https://github.com/ephtracy/voxel-model)
Support this project with a ⭐️, report an issue or if you feel adventurous and would like to extend the functionality open a pull request.