Voxelizes .obj models with textures into colored .vox files
This was built using AI. I have no idea how long this would have taken me if I did it fully myself. This is free and only took a couple days of work. My original goal with this was so I could import 3d models into Teardown. However I'm also working on a Vox to Minecraft Schematic/Litematic converter and plan to eventually release an all in one.
Setting up the OBJ
Currently this tool has only been tested to use Base Color and Alpha on Principled BSDF in Blender to decide color/opacity. Before using this tool, make sure your OBJ has your desired color or image set to the base color for all visible materials and optionally either the alpha map from a PNG or an opacity map plugged into the alpha, though make sure that if using an opacity map it doesn't have an alpha channel with any transparency. A good rule of thumb is that if the model doesn't look correct in Blender using only the base color, it is not going to look correct after being voxelized. In the image below the model still looks good even after disconnecting the specular texture, so this should be good to go.
Also make sure that rotation and scale are correct and have been applied with CTRL + A.
If any changes have been made, export the OBJ to your desired folder. I reccomend using Path Mode: Copy.
Drop OBJtoVoxX.X.exe into the model folder, and search CMD in file explorer's search bar and press enter
In the CMD window, run OBJtoVoxX.X.exe modelname.obj
This should create a file named "modelname_0_12.vox". Open this in MagicaVoxel to confirm it looks correct. If the model is missing textures, this could be because the texture is no longer where the MTL file expects it to be. If texture files use special characters like chinese characters, may not work either.
There should now also be a config.txt present in the folder. Click it to open the config
You can then edit the values
Edit and save the config file, then run the command again to voxelize with the different settings. Explanations for each variable are in the config file, but will give examples of what they do here:
chunksize: Default 128. Anything greater than 256 will cause integer overflow and corrupt the .vox. Smaller chunks use less RAM during conversion but may take more time and hard drive space
maxDim: Maximum dimension size, automatically lowers scale if scale is too big. MagicaVoxel squishes/poorly handles .vox files with dimensions greater than 2000x2000x2000 voxels, but other software (Like Teardown) can handle large dimensions well.







