[Mod] Voxelizer [voxelizer]

Post Reply
User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

[Mod] Voxelizer [voxelizer]

by LMD » Post

Image

Voxelizer (voxelizer)

Turns 3D models into astonishing voxel builds. Sort of the opposite of wesh and meshport.
Another mighty world manipulation tool like worldedit. Blazing fast.

About

Note: Voxelizer needs to be added to the "trusted mods" if "mod security" is enabled. You should always ensure that all your "trusted mods" run in a safe environment (which means that all other mods are safe as well).
Depends on modlib and cmdlib. IntelliJ IDEA with EmmyLua plugin project.
Code licensed under the GPLv3 for now.
Written by Lars Mueller alias LMD or appguru(eu).
Media licenses (files in the media folder): Logo license (logo.png): derived from character.png by Jordach (see above), same license (CC BY-SA 3.0), rendering & modifications by me (LMD)

Links
  • GitHub - sources, issue tracking, contributing
  • Discord - discussion, chatting
  • Minetest Forum - (more organized) discussion
  • ContentDB - releases (downloading from GitHub is recommended)
Screenshots

Image

Some Sams, using reduced palettes.
Image

Another Sam, using the full colors.txt palette from Minetestmapper.
Image

Same Sam, rear view.
Image

2 mages & Ironmen (thanks to Jordach and Ginsu23 for the skins)
The used texture pack was MTUOTP by Aurailus and GamingAssociation39.
Other textures seen are from Minimal Development Test or the Wool mod (wool textures by Cisoun).

Usage

All commands are executed with /vox {params}. If in need for help, just do /help vox.
You need the voxelizer priv to use any of the Voxelizer commands. Some commands require extra privs.
Media - models, textures and nodemaps (color lookups) - is stored in /media.
If you are unsure about which settings to use, either do some research or try it and see.
Editing the placed models is recommended; Voxelizer might place a few blocks undesirably, which needs to be fixed by hand.
Voxelizer needs to be added as to the trusted mods in the settings in order to be able to read textures or download files.
Disabling mod security would also work but is not recommended.

Configuration

Per-player configuration commands. Configuration remains after shutdown (is persistent).
  • texture [path] - set/get the current texture (see Supported File Formats)
  • nodemap [path] - set/get the current nodemap (see Supported File Formats)
  • dithering [id] - set/get the current error diffusion dithering algorithms (specify algorithm ID)
  • color_choosing [id] - set/get current color choosing mode (best/average)
  • filtering [id] - set/get current filtering mode (nearest/bilinear)
  • placement [id] - set/get merge modes (specify mode ID)
  • model [path] - set/get the current 3D model (see Supported File Formats)
  • alpha_weighing [enable/disable] - get/enable/disable weighing colors (see color_choosing) by their alpha
  • protection_bypass [enable/disable] - get/enable/disable protection bypass (you need the priv protection_bypass to enable it)
  • precision [number] - set/get the current rasterization accuracy (integer). Note that this increases computation time quadratically. Values higher than 10 are not recommended.
Supported file formats


Textures

All file formats supported by ImageIO on your Java setup. You can find them out using the following commands :

Code: Select all

cd ~/.minetest/mods/voxelizer/production/voxelizer
java SupportedTextureFormats
On my system (Java 11), the output was :
The supported image file formats are : JPG, jpg, tiff, bmp, BMP, gif, GIF, WBMP, png, PNG, JPEG, tif, TIF, TIFF, wbmp, jpegInternally, the SIF (.sif, "Simple Image File") file format (just gave it some name) is used:
  • 4 byte header : 2 times a 2 byte unsigned short, first is width, second is height
  • Followed by uncompressed image data : array of 4 byte tuples, consisting of ARGB unsigned bytes, positions in array are calculated as x + y * width
Node Map

Any valid minetestmapper-colors.txt will be accepted by this mod. The format is :
Multiple lines like [(|) ][#]

3D Models

Only the .obj file format is (with certain restrictions) supported. It is recommended to export your models from Blender.
Restrictions :
  • No free form geometry (vps)
  • No complex texture coordinates (vts with more than 2 coordinates given), use simple ones
  • No polygonal faces (fs with more than 3 indexes), use triangles
  • No line (l) elements
  • No material (.mtl) file usage, only a single texture
  • No smooth shading (s)
  • No normals (vn)
All of the above will be ignored whenever possible.
Export your .obj files with Blender properly by ticking the right options, as seen here :
Image

So summarized, the following boxes should be ticked :
  • Apply modifiers
  • Write normals (not required)
  • Write UVs
  • Triangulate faces
  • Objects as OBJ objects
Everything else should not be ticked.

Actions
  • 1/2 - set first and second edge position, model will be placed thereafter and positions will be deleted
  • place [scale] - place model with given scale (defaults to 1)
  • download [filename] - download a file from the internet using a GET request, requires voxelizer:download priv additionally.
    File will be downloaded to /media/filename. The URL filename will be taken if filename is not specified.
Configuration

JSON Configuration: /config/voxelizer.json
Text Logs: /logs/voxelizer/.txt
Readme : /voxelizer/Readme.md
Default Configuration : /voxelizer/default_config.json

Code: Select all

{
  "max_precision" : 15,
  "download" : true,
  "defaults" : {
    "precision" : 4,
    "min_density" : 0.1,
    "dithering" : 10,
    "placement" : 1,
    "color_choosing" : 1,
    "filtering" : 1
   }
}
max_precision

Integer, maximum settable precision.

download

Boolean, whether to enable the /vox download chatcommand.

defaults

Dictionary / table, default names assigned to corresponding values. Possible names below.

min_density

Float between 0 and 1. Minimum density default.

precision

Integer > 1 and < 100. Precision default.

dithering

Default dithering algorithm ID (see /vox dithering).

placement

Default placement mode ID (see /vox placement).

color_choosing

Default color choosing algorithm ID (see /vox color_choosing).

filtering

Default filtering algorithm ID (see /vox filtering).

model / texture / nodemap

Optional default filenames. Files will be searched in world's media folder.
If not given, Voxelizer falls back to default files from mod's media folder.
Last edited by LMD on Mon Dec 28, 2020 17:34, edited 21 times in total.
My stuff: Projects - Mods - Website

User avatar
Zalera
Member
Posts: 42
Joined: Mon Jul 22, 2019 01:46
GitHub: Zalera
IRC: Zalera
In-game: Zalera

Re: [Mod] Voxelizer - turns 3d models into buildings [voxeli

by Zalera » Post

LMD wrote:Voxelizer
Turns 3d models into astonishing voxel builds.
Image
Image
Image
Image
Image
For more info, please visit GitHub : https://github.com/appgurueu/voxelizer
Hi. There's a problem when you type "/vox 2" pos - the game crashes - Minetest 5.1.0 .

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Voxelizer - turns 3d models into buildings [voxeli

by LMD » Post

Hi ! Please provide the error (how does it crash?)

Also make sure that you have the newest versions of modlib, cmdlib and voxelizer.
My stuff: Projects - Mods - Website

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Voxelizer - turns 3d models into buildings [voxeli

by LMD » Post

Update: I managed to reproduce the error, and will try to fix it as soon as possible.
My stuff: Projects - Mods - Website

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Voxelizer - turns 3d models into buildings [voxeli

by LMD » Post

The cause for the error is mod security, disallowing "os.execute" calls for security reasons.
It has been "fixed" - Voxelizer now requests an insecure environment and obtains "os.execute".
I also left a notice in the Readme - Voxelizer needs to be added to the trusted mods. See the commit here : https://github.com/appgurueu/voxelizer/ ... 1457cd0161
Thanks for your bug report ! I likely wouldn't have found this without it, as I had tested with mod security disabled. But of course this is not always an option for players.
My stuff: Projects - Mods - Website

User avatar
Zalera
Member
Posts: 42
Joined: Mon Jul 22, 2019 01:46
GitHub: Zalera
IRC: Zalera
In-game: Zalera

Re: [Mod] Voxelizer - turns 3d models into buildings [voxeli

by Zalera » Post

LMD wrote:The cause for the error is mod security, disallowing "os.execute" calls for security reasons.
It has been "fixed" - Voxelizer now requests an insecure environment and obtains "os.execute".
I also left a notice in the Readme - Voxelizer needs to be added to the trusted mods. See the commit here : https://github.com/appgurueu/voxelizer/ ... 1457cd0161
Thanks for your bug report ! I likely wouldn't have found this without it, as I had tested with mod security disabled. But of course this is not always an option for players.
Ok. I'm just only interested about it can create statues by using *.obj meshes... That's awesome. And excellent job LMD. Voxelizer is very powerful. I'm using on a tiny singlenode map. Thanks for your answer. One question: What option to I need to disable: strict_protocol or another one? When you mean to be trusted mods, it's to copy/paste into ...\games\minetest_game\mods file?

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Voxelizer - turns 3d models into buildings [voxeli

by LMD » Post

> excellent job LMD
Thank you !
> What option to I need to disable: strict_protocol or another one?
In Minetest settings, search "secure.trusted_mods". It's a list of mod names, seperated with commatas, like "mod1, mod2, mod3". Append Voxelizer to that list ("mod1, mod2, mod3, voxelizer"). If there are no mods, then just set it to "voxelizer".

Do you have Discord ? I'm considering opening an Support Server for my stuff. You can also reach me over the Unofficial Minetest Discord, however.
My stuff: Projects - Mods - Website

User avatar
Zalera
Member
Posts: 42
Joined: Mon Jul 22, 2019 01:46
GitHub: Zalera
IRC: Zalera
In-game: Zalera

Re: [Mod] Voxelizer - turns 3d models into buildings [voxeli

by Zalera » Post

LMD wrote:> excellent job LMD
Thank you !
> What option to I need to disable: strict_protocol or another one?
In Minetest settings, search "secure.trusted_mods". It's a list of mod names, seperated with commatas, like "mod1, mod2, mod3". Append Voxelizer to that list ("mod1, mod2, mod3, voxelizer"). If there are no mods, then just set it to "voxelizer".

Do you have Discord ? I'm considering opening an Support Server for my stuff. You can also reach me over the Unofficial Minetest Discord, however.
Dude. I've got the same issue after doing this. The game crashes after I type /vox 2. I don't know why...

User avatar
Zalera
Member
Posts: 42
Joined: Mon Jul 22, 2019 01:46
GitHub: Zalera
IRC: Zalera
In-game: Zalera

Re: [Mod] Voxelizer - turns 3d models into buildings [voxeli

by Zalera » Post

You should do a video tutorial.

The next I'm going to do it's to try this mod in a new minetest game folder - with only one world. I was testing on my usual minetest game file - which I've got 4 worlds.

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Voxelizer - turns 3d models into buildings [voxeli

by LMD » Post

As said, it's working smoothly for me. Have you changed the settings as shown below ?
Image
If it still doesn't work, please open an issue on GitHub or here, including a screenshot of the error, and additional info.
Attachments
Bildschirmfoto von 2019-09-15 12-46-35.png
Bildschirmfoto von 2019-09-15 12-46-35.png (24.41 KiB) Viewed 1668 times
My stuff: Projects - Mods - Website

User avatar
Zalera
Member
Posts: 42
Joined: Mon Jul 22, 2019 01:46
GitHub: Zalera
IRC: Zalera
In-game: Zalera

Re: [Mod] Voxelizer - turns 3d models into buildings [voxeli

by Zalera » Post

Yes, I did it - by following your mod's instructions. But I still having the same issue. Does this mod uses java? Maybe I should upgrade my java plugin version.

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Voxelizer - turns 3d models into buildings [voxeli

by LMD » Post

Yes, it uses Java. If you have the newest Java version, it should work.

However, I have to admit Voxelizer was tested on Ubuntu, so I'm not sure whether the shell commands I'm using("java ...") also work on Windows.
My stuff: Projects - Mods - Website

User avatar
LMD
Member
Posts: 1386
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Mod] Voxelizer - turns 3d models into buildings [voxeli

by LMD » Post

Update: After some discussions, I realized you also have to add Java to the system PATH
My stuff: Projects - Mods - Website

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests