An open API service indexing awesome lists of open source software.

https://github.com/elenaches/blender-unity-settings-voxel-models

A Blender add-on for Voxel 3D models, streamlines optimising MagicaVoxel models to be used in Unity, can also create low level-of-detail version of models.
https://github.com/elenaches/blender-unity-settings-voxel-models

3d-models blender blender-3d blender-addon blender-script magicavoxel magicavoxels python unity unity3d voxel-models

Last synced: 25 days ago
JSON representation

A Blender add-on for Voxel 3D models, streamlines optimising MagicaVoxel models to be used in Unity, can also create low level-of-detail version of models.

Awesome Lists containing this project

README

          

# Blender Unity Settings for Voxel models




A Blender add-on for Voxel 3D models.

Streamlines optimizing MagicaVoxel models for Unity and can create low level-of-detail versions of models.

> [!NOTE]
> The default parameters that my team found fit Unity best are included in the attached images.

Content

- [Dependencies](#dependencies)
- [Installation](#installation)
- [Panels](#panels)
- [Model Settings](#model-settings)
- [Quick Export](#quick-export)
- [Process Model](#process-model)
- [Level Of Detail](#level-of-detail)
- [Usage](#usage)


# Dependencies

The add-on relies on two existing add-ons and won't work without installing them first:

1. VoxCleaner v1 by Farhan Shaikh - [Github repo](https://github.com/TheStrokeForge/Vox-Cleaner).
2. Texel Density Checker v3.3.1 by Ivan Vostrikov - [Addon page](https://mrven.gumroad.com/l/CEIOR).

The add-on may work with other versions, but these are the versions that were used during development.

> [!TIP]
> You can read how to install Blender add-ons [here](https://docs.blender.org/manual/en/latest/editors/preferences/addons.html) or search for another guide online.

# Installation

1. Install the dependencies.
2. Download `UnitySettings_1_1.py` and add it to Blender.

# Panels

## Model Settings

- `Model` - defines the texture map size.
- `Island Margin` - used when packing islands.
- `Set TD` - parameter that Texel Density Checker needs to update TD.
- `New Model` - quickly import a new Obj and remove anything extra from the scene.

## Quick Export


- `Auto Export` (recommended) - whether to automatically export Texture and Obj(s) after processing.
- `Texture Path` - location for the Texture export.
- `Flip Z axis` and `Scale` - auto-selected when exporting.
- `Model Path` - location for the Obj export (also used for low LOD version if created).

> [!CAUTION]
> If `Auto Export` is unselected, the path inputs will turn into manual `Export` buttons. Remember to export both Texture and Obj after processing!


> [!NOTE]
> If a low LOD model was processed, the Obj panel updates to reflect that.

## Process Model

- `Use smart process` (recommended) - whether to condense all processing steps into a single click.
- `Smart Process` - runs 7 steps to process the MagicaVoxel (or other voxel) model and optimize it for Unity.

> [!NOTE]
> If `Use smart process` is unselected, you can run steps individually:
>
> - `Start Process` - removes all objects except selected.
> - `Prepare For UV` - uses VoxCleaner's `Prepare For UV`.
> - `Pack Islands` - cubes projections and packs islands.
> - `Update TD` - uses Texel Density Checker's `Set My TD`.
> - `Set To Pixels` - snaps islands on texture to fit pixels.
> - `Bake Texture` - uses VoxCleaner's `Bake Texture`.
> - `Pretty Polygons` - triangulates polygons for better efficiency in Unity.

> [!TIP]
> In most cases, it’s best to use `Smart Process` instead of individual steps.

## Level Of Detail

- `Decimate` - how much to reduce the face count of the mesh.
- `Process` - decimates the model and creates a low LOD version.

> [!IMPORTANT]
> You must process the model before creating a low LOD version.

# Usage

1. Select the `Unity Settings` tab (press `N` if it's not open).
2. Verify that all the settings match your preferences.
3. Click `New Model` and import your model, then select it in the scene.
4. Enable `Auto Export` and select paths for the Texture & Obj.
5. Enable `Use smart process` and click `Smart Process`.
6. Confirm saving in the window that opens.
7. If creating a low LOD version, click `Process` in the `Level Of Detail` panel and confirm saving.