-
Notifications
You must be signed in to change notification settings - Fork 1
Import MagicaVoxel models into Godot #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Reading this comment CloneDeath/MagicaVoxel-Importer-with-Extensions#9 it seems that it is better to export vox file to OBJ in MagicaVoxel so the model is built from independent meshes. |
In order to manage meshes as groups we have the https://docs.godotengine.org/en/stable/classes/class_meshlibrary.html#description It is used in gridmaps, and in some way, a voxeled structure is a grid of cubes, a grid of meshes. Also for modifying a mesh we have the https://docs.godotengine.org/en/stable/classes/class_meshdatatool.html Probably this two modules can help building models from voxels, which are cubes (or other form for the voxel) that are meshes. |
Interesting project: https://github.com/antopilo/VoxelFactory It can import voxel files. This is exactly the direction we want to follow. But it is using C#, so we need Godot Engine with this support. But probably it deserves the time needed to play with Godot C#. But the bet is to use https://github.com/Zylann/godot_voxel and try to extend it not only to terrain but to other objects. |
An interesting project http://www.rpginabox.com/ pointed out in https://godotengine.org/qa/20788/how-to-generate-voxels |
VoxelFactoryThe C# version is the same than the GDScript version. So we can play with the Godot C++ using GDScript. Great! I have tested the image loading with voxels: The problem with then GDScript version is the performance. But we will reach this issue in the future. The current API is: and the workflow is to add voxels and once you have finished, call create_mesh. It is a pretty basic library, supporting a basic voxel editor in godot. A good inspiration but limited. Our goal is to have each voxel as an independent mesh with its own physics. |
Ok, following Zylann/godot_voxel#194 the plan is:
|
Ok, let's try to use the code from Zylann/godot_voxel#194 (comment) to load a first model. The support for loading vox files was added some days ago: Zylann/godot_voxel@e1b9a25 |
Ok, the import of magica voxel files is working with the godot_voxel support. This ticket can be closed. |
In order to complete #1 let's import the voxels models from MagicaVoxel!
There are already some support for importing vox files. Let's follow https://threepointfivecats.be/cat/games/b/blog20190317.php for the first test.
It seems the vox model is imported like an ArrayMesh. Let's try! The plugin in the assets library seems to be this one: https://github.com/scayze/MagicaVoxel-Importer
There is an evolution from this project at https://github.com/JohnCWakley/vox-importer and there is a fork from this one in https://github.com/CloneDeath/MagicaVoxel-Importer-with-Extensions so not sure what I will find in the assets library.
It is great to read the plugin code to learn howto extend the Godot Editor from GDScript: https://github.com/scayze/MagicaVoxel-Importer/blob/master/addons/MagicaVoxelImporter/plugin.gd
From a quick review, the importing code for vox files seems to be pretty limited so probably not all the details are imported. Let's try it. After reading then above article, we are going to have issues for sure in this workflow. But it is going to be interesting.
Our goal is to import the vox model as voxels (cubes by default) so when we hit the model, it can breakdown from this voxels. Let's see if it is possible.
The text was updated successfully, but these errors were encountered: