CloneDeath / MagicaVoxel-Importer-with-Extensions

A Godot plugin to import MagicaVoxel .vox files as meshes.
21 stars 6 forks source link

Layer ordered mesh building #14

Open jon-heard opened 1 year ago

jon-heard commented 1 year ago

When using MagicaVoxel layers, it's sometimes necessary to overlap two models. For instance, if a low-res figure wears a thin shirt, then it makes more sense to overlap the torso voxels with the shirt voxels, rather have the shirt pad a voxel out from the torso.

This pull request adds user control over which models are "on top" by doing the model merging in order of layer. Layers further down are merged after earlier layers, so the further down layers (with higher layer ids) take precedence.


Note: This pull request sits on top of my previous pull request: "Layer visibility affects what voxels are shown in Godot". This pull request is actually 2 commits to a single file, "vox-importer.gd".