Logo 3.5Cats_AndHalfAFish



March 16, 2019 Bethee, MagicaVoxel
Getting started with MagicaVoxel, Blender, and Godot (part 1).

Personal note : I have decided to be more transparent about what it is like for me, to be a creative person with an aging autistic brain.
If I could only use one word to describe my life, it would be : 'frustrating'. I have all these exciting ideas floating in my head (they are most alluring at night) ... and no energy to act on them (during the day). I barely manage to get through the most basic day-to-day chores. Browsing my Twitter feed is agony : so many people working on so many wonderful games.
2019 started in low-energy mode (hence the low number of posts), but March seemed a bit better and so I started this series of posts about MagicaVoxel and Godot. My aim is to make a small, simple 3d game in the point&click genre. Enjoy the read. =)

Disclaimer : I don't claim to know what I'm doing ; I'm discovering things as I go.

I'm using MagicaVoxel 0.99.3, Blender 2.76, and Godot 3.0.6.

MagicaVoxel is a free, lightweight, 8-bit voxel art editor and renderer created by Epitracy.
In other words : pixel art in 3d.

I find the interface rather confusing and the workflow a bit tricky. But, the developer is still doing a lot of work on MagicaVoxel ... So perhaps it will get better in the future (or I'll get used to it).
Either way, the editor is a very useful tool for people with limited art skills (like me).

Model view UI - MagicaVoxel (1/2).
MagicaVoxel UI : Model view (= editor) (1/2).

(1) The first thing you need to do before anything else is decide on the palette (colors) you're going to use.
I find it easiest to start with an empty palette (btn 3 under the word 'palette'), but you could also use one of the predefined ones (btns 0-2).
Notice that all palettes have 1 black, unclickable slot on the top right (not sure why that is).

(2) If you see the World section instead of the Brush section, you might have accidentally pressed 'tab'. Use the tab key, or the dubble arrow btn, to toggle between the two.
If you see the Light section, you are in the Render view. Press the Model btn to switch.

(3) Tool hints show up here (move the mouse cursor around over the UI and viewport). If you don't see the hints, press the arrow btn next to the camera btn.

Model view UI - MagicaVoxel (2/2).
MagicaVoxel UI : Model view (= editor) (2/2).

(1) Next, you need to decide how big your model is going to be. The max size seems to be 126x126x126 voxels. You can combine multiple models in the world view though (tab key). Note that you can adjust the size of the bounding box while you're working on your model.

(2) The program starts up with a filled cube of 40x40x40 voxels. This means you can only use the Erase btn to 'carve' your model out of the voxel block (like a sculptor).
If you prefer to start with an empty space and build your model up (like clay), press the Del btn on the right. Then use the Attach btn to add voxels.

Model UI - MagicaVoxel.
MagicaVoxel UI : Moving around / Looks.

There are quite a number of ways to move around inside the viewport.
Mouse : RMB for rotation, MMB for panning, mouse wheel for zoom.
Keyboard : A/D and Q/E for rotation, W/S for zoom. Not sure if you can pan this way.
UI (1) : The middle btn enables the two short scrollbars you see just above the btns. You can click and drag the mouse over them to rotate the view. The btn on the right enables a cube widget with 3 axes to click on for rotation (previous figure). The left button centers the view. I'm not sure what the '0 (camera)' btn does ...

(2) This area lets you set a camera view type : perspective / orthogonal / isometric / free.

(3) Here you can customize the layout of the viewport.
BG : Display background objects. Only relevant if you have multiple objects in your world ('tab' btn).
Edge : Show a black outline around the model.
SW : Use shadows. This makes it easier to see what's going on.
Grid : Show the model boundary box with a voxel sized grid.
10 Frame : Show the model boundary box with a custom sized grid (here : 10x10 voxels).

(4) Take a snapshot of the viewport (for later enjoyment).

Model UI - MagicaVoxel (1/2).
MagicaVoxel UI : Creating a model (1/2).

(1) I guess there are 2 ways to work : create everything using a single color, and paint the model afterwards, or, use the correct color while you're creating your model. In the second case, you need to pick an empty cell in the palette grid, and a color (beneath the grid). SAVE THE PALETTE RIGHT NOW !!! ('download' btn beneath palette grid) There seems to be a bug (?) in MagicaVoxel that will reset your custom palette if you click on any of the other palette btns ! If you have a saved palette, you can reload it with the 'Folder' btn.

(2) These are the 3 'action' options : attach voxels / erase voxels / paint voxels. These options need to be combined with the options in area (3) for the brush.
You can set the brush to use Voxels ('vertex' in eg/ Blender) or Lines ('edge') (yellow shapes in my model). The Faces brush ('face' combined with 'extrude') is quite powerful. I used it (with 'attach') to created the orange 40x40x1 box with just 1 click on the empty backside of the model bounding box. Using this brush on an existing surface, eg/ the yellow line shape, will extrude it (add an extra layer to it).
Also notice that you get extra options in area (4), depending on the brush type you select !
Continuing with the brushes ... I used the Center brush to create the green circle and the 2 squares. The hole at their center will be either 1x1 or 2x2 (Even / Odd option). The Box brush is nice and simple ; it created the blue rectangle. The Pattern brush is also quite powerful. It lets you create 'stamps'. You can select an existing shape from your viewport (or a previously created pattern from a list) and quickly make copies in your viewport.

(5) Save your project as a .vox file. Remember to also save your palette as you add colors to it !

Model UI - MagicaVoxel (2/2).
MagicaVoxel UI : Creating a model (2/2).

(1) The 'Edit' section presents you with even more options. Some more commonly used tools can be found under the 'Select' btn : select everything / nothing in the viewport, select the inverse, copy / cut and paste. There are also tools for rotating, scaling, etc.
The 'Shape' tool lets you create predefined shapes : ellipsoid, cylinder, pyramid, and cone (they fill the entire boundary box !)

(2) And finally : the Export options.
To use your model in Godot, you have several options.

  • Install the Godot addon 'MagicaVoxel Importer' by Scayze. This lets you use the .vox file as is (no export required).
  • Export your model to .obj (wavefront) and import into Godot. You will also need your saved palette (.png file).
  • Export your model to .obj or .ply (Stanford) and import in Blender. Clean up, or do whatever. Export as .dae (Collada) or .obj, and import into Godot.

I'll expand on these options in the next blog post, as this one is already quite long ...