Voxel Importer

About
Import “MagicaVoxel”, “Qubicle” and Pixel art.
Animation your voxel character!

Features

  • Skinned Animation support (Create skinned mesh)
  • Frame Animation support (Swap mesh engine)
  • Mecanim Humanoid support
  • ScriptedImporter support
  • Optimize low poly mesh
  • Collada Exporter
  • The source code is all C#
  • All source code is included

Manual
http://alonesoft.sakura.ne.jp/VoxelImporter/index.html

FAQ
http://alonesoft.sakura.ne.jp/VoxelImporter/index.html

1 Like

Thanks for creating this thread. Bought Voxel Importer a couple of days ago so I am still trying to learn how to use it in Unity 2018.1. Anyhow, I found out that upon importing a model from MagicVoxel, it seems the rotation is reversed/wrong. Is there a way to correct this within Voxel Importer? Pls. refer to the attached image below. In Mixamo, importing and exporting works correctly in FBX and it also automatically resizes the model for use in Unity.

Secondly, when I tried following your video tutorial when assigning Materials, I experienced a bug somewhat. If I forgot to uncheck the “Load From Voxel File” in the Inspector tab and I switched to the Lighting tab then clicked Generate Lighting, all of my previously assigned materials in the Shader section disappears and loads those that were originally set when I imported the model from MagicaVoxel. Is that really how it works? Do I need to uncheck “Load From Voxel File” before generating the newly assigned materials? I noticed the default values/layout in the Lighting tab were also different from those in your old tutorial so its kind of difficult to find the correct settings.

  • Each of the 3D tools often has different basic axes, rotation directions, and so on.
    In this case, Unity is Z + in the front. MagicaVoxel is Y - on the front.
    There are differences depending on software like this.
    Voxel Importer conforms to the same result as importing obj data exported from MagicaVoxel into Unity.
    Therefore, the current result is normal.
    In other words, it is correct to flip the current data with MagicaVoxel.
    Please check chr of sample data of MagicaVoxel.
    They are facing Y -, and the character of the image is for Y +.

  • Updating with ‘Load From Voxel File’ enabled means that all materials are recreated from vox.
    Uncheck this if you want to set the material by Unity yourself.
    The video is created in the state of Unity 5.4.0, etc. There is a change in the update of Unity.
    For example, it is impossible to set the Emission color unless you enable Emission checking.
    This is a Unity update, so you need to check the Unity documentation.
    Especially light map etc. has big change with Unity update, so always check the Unity document.

Thanks for the reply! Ok, I will just flip my models in MagicaVoxel. But you know it would be great if there is just a check box/option in your tool that allows this within the imported model in Unity just like how your scaling works. For the “Load From Voxel File” issue, it took me a couple of tries to understand how it works and how to manage Emissions. I suggest you at least make a quick note in your video tutorial on this especially on the new settings in the Lighting tab just so to avoid confusion for newbies and to also fast track understanding on how to use your tool. :slight_smile:

Another question: How do you identify an imported models’ number or rather count/amount of Tris and Verts within Voxel Importer?

3525088--282212--mesh.png
The number of vertices etc. are displayed in Mesh’s preview.
This will vary depending on settings such as optimization options and weight paint.
This is because the elimination of invisible faces is related to the result.

Thanks for the reply! I found the Mesh Preview and tested the optimization. I haven’t used the Weight Paint yet but have a few questions regarding some of the Import Settings particularly those under "Optimize". What does Combine Voxel Faces and Ignore Cavity mean and do they reduce Tris and/or Verts count? I don’t seem to notice any difference when I ticked/unticked them and pressed the Refresh button.

I also made some observations. I imported the same model from Mixamo w/ a basic animation and compared it with an imported .vox file using Voxel Importer (no animation). I noticed a difference in the number of Tris and Verts. Voxel Importer has lessened the number of Tris but has higher Verts count compared to the mesh from Mixamo (.fbx). I’m wondering, is it better to have lesser Tris count over Verts count?

Basically, you do not need to remove optimization options.
If ‘Combine Voxel Faces’ is not valid, the face of each voxel remains. It is a lot of vertices and it is very wasteful.
‘Ignore Cavity’ prevents invisible inward surfaces from being created when there are cavities in the voxel.
If there is no cavity, the result will not change.

Vertices and triangles vary depending on weight paint setting etc.
Of course, the lesser is better, but in modern times other factors such as the number of materials will have a big impact on performance.
We estimate that this degree of difference will not have measurable effects.
If you want to reduce it, reduce the corner of the voxel
Then vertices and triangles decrease.

Alright, I think I understand what you mean. But reducing the corners of the model may change its look entirely. Will reducing the inside number of voxel cubes of the model further optimize it… or does Voxel Importer already do that upon import?

Also have a question regarding Animation. I’ve noticed you can Add Root and Child Bones and there is an Edit Bone Animation button. Does this only setup the model for animation and not really allow me to create new animations like walking, running, etc? Do I still need Very Animation tool for that?

Voxels with many corners inevitably have many vertices and triangles.
Currently, we can not optimize further.

What you can create with Voxel Importer is simple like SD_Human sample animation.
It is not suitable for creating full size Humanoid animation.
Use assets such as VeryAnimation and UMotion to create animations.
Or export it with Dae and create it with Blender etc.

Ok, but how can you use this with other animation tools aside from Very Animation? Does those tools (like Umotion or Puppet3D) need to support .vox file first as well for better integration or do I have to export Collada Dae files first? I’m wondering because the connection with any animation done in another tool might break if I ever “refresh” an updated model in Voxel Importer.

The model created by Voxel Importer is the same one that is the same as other Unity models once setup is completed and it is set to Prefab.
You should be able to use other animation assets as they are.
That is because for Unity it is the same thing created from FBX and from Voxel Importer.
Unless you change the settings or change the contents of the voxel, the result of Refresh will not change.
If you are worried that problems will occur even in the unlikely event, please output it as a Dae file.
If so, the problem peculiar to Voxel Importer should not occur.

Great! Thank you for the patience and for answering all my questions! I appreciate it very much! :slight_smile:

Hi again! I’m now trying to use the Weight Painting for Voxel Skinned Animation Object. I cannot seem to modify the weights for the Hip Bone. The controls are not present. Pls. see image below:

How do I remove the weights for the knees? I repeated the process 3 times for this model and there are always irregular weights in other parts of the body being left for the Hip Bone even if I am actually done doing weights for other body parts.

Solved it! I was able to fix this by just adjusting the knee bone and made sure the covered voxels are “thin” enough for it to bend correctly. :slight_smile: Still, I haven’t successfully connected a good animation as the legs seem to get twisted. Will experiment with this further.

It seems to have been solved, but I supplement it.
The Weight result of Root corresponds to those for which other weights are not set to Weight.
The vertex where weight is not set automatically means Weight is set to Root.
By setting the total weight of 1.0 on the knee etc., the weight setting does not exist in Hips.

Just came back to rigging. I’m really new to weight painting 3D models. I thought I solved this but I noticed legs does not work correctly. Both legs slightly rotates as knees seem to “magnetically” connect with each other. Should I set a weight of 1 for the knees? What does the colors mean? I guess red is heavier and blue the lightest weight?

The meaning of color is the same as that expressed by common DCC tool such as Blender.
In the absence of these knowledge, it is better to simply try 0 or 1 paint and check its operation.
https://docs.blender.org/manual/en/dev/sculpt_paint/painting/weight_paint/introduction.html

As an example of Weight, please check the setting etc. of this movie.
The setting of Weight will change depending on how you want to transform the voxel.
Please display subtitles by automatic translation.

https://www.youtube.com/watch?v=Lhl4MHKVj3w

1 Like

Ok, will try this out. That’s the first time I saw that video and it has English subtitles that is decently translated! Thanks for the assistance! :slight_smile:

I’m now trying to control _EMISSION of a material in an imported Vox model and this error constantly appears (please see image below). Will appreciate any tip on how to fix this.

Do I need to divide the model into two parts to have two separate materials so I can control the one with the emissive color? …or will it work with just having one model with two separate materials?