Blockbench a low poly 3d editor can be used to create 3d assets for your games and can also be used to create animations. In this small guide we will go over exporting animations to be used in defold.
There are 2 ways to animate in Blockbench. One is using armatures with weight painting. The other way is using groups as transform pivot. Lets go through each setup in Blockbench then go over how to use them in Defold. Also note that in defold we have z as our forward axis you can keep this in mind while working in blockbench to match.
- ARMATURES
In order to use our skeletal animations in defold we need to follow some simple rules. The main rule is that we need to use a single root bone for our model. In blockbench we add armature bones to the outliner. I setup the bone hierarchy within a root bone. All other bones must be attached to this root bone. Next we make sure to add the models mesh to the armature (head, torso, arms, legs etc.). Then you go to weight painting mode select a bone and paint the desired weight value to the vertices the bone will influence. After that you are ready to animate and then export. If you are looking for specifics on how to setup armatures and weightpainting in blockbench here is a good tutorial. When your ready to export your model and animation you can do so by going to file>export>glTF model. The options - Encoding can stay as is (ASCII), Model Scale is ok at 16, however you can scale as needed for your project. Embeded textures, For the textures I would save them separate to your project and apply them later in defold. Groups As Armatures , we are using armatures for this animation so we can leave this one unchecked. Export Animations check this one as we do want to export animations with our glTF file. Confirm and add the file to your defold project.
- GROUPS
Groups in Blockbench are basically pivot points for mesh object(s) that can be animated. When we set them up in Blockbench for use in defold we need to follow the same hierarchy rule as armatures so we create a “root” group, in the example image its named as “character”. Then all grouped mesh parts we also want to animate are added to the root group. This keeps the exact same structure as the armature and will work when we bring it into defold. This method its a bit more simple and just transform animation because each group gets a full weight value automatically assigned to mesh objects in them. For more elaborate animation rigs use armatures and weight painting instead. Now when exporting the settings should be the same except now we want to check “Export Groups As Armature” and thats it! now add it to your project.
- Defold setup
In defold we create a .model component and add our Blockbench exported .glTF file to the mesh property. We also add the glTF file to both skeleton and Animations properties. For any materials since we use animation for our mesh is it important to use a skinned material so we add model_skinned.material from builtins. If you exported any textures heres where you would add them. You can choose a default animation or play one during runtime using api. Now its ready to add to a collection and see the asset animated in defold. ![]()
Here is a simple Defold(1.11.2) sample project also included is the Blockbench project files.
sample_blockbench_animation.zip (26.8 KB)
Cheers~



