How to import GLTF animations in Minsar





Minsar supports only .obj and .glTF or .glb formats for 3D objects. It doesn't support .fbx yet, which is for now the most famous format for 3D and animations. However, the .gltf (and .glb) format is an open-source and free format whose ambition is to compete with .fbx. As a result, it does support animations. Minsar is able to read an animation which is contained in a .gltf file. However, the feature is very new, so here are a couple of things you should keep in mind.

Default GLTF animations

  • Currently, Minsar supports only Transform and armature / bones animations. Blendshapes or vertex animations will not be read.

  • You must have one animation per object. Let's assume you have three cubes in a Blender scene. Each cube has a small animation. If you select all the cubes and try to export them as a single object, only the last cube's animation will be read. You must export each cube separately for its animation to be read.

  • While animating an object, always prefer Quaternion animation rather than Euler Angles.

  • Don't forget to Freeze the transforms of both your object and armature before exporting them, or you will get some pretty messed up animations.

Make sure your animation will be read in Minsar

To be sure your animation will be read correctly in Minsar, you should first pass your object and its animation through a 3D software such as Blender in order to export it in .glb. In this tutorial, we will show you how to do that, and highlight the essential aspects which should catch your attention.

Native format

Of course, if your object is already in .glb when downloaded from Skechfab, you don't need to process it in Blender. Just unzip your downloaded object, check that the 3D model in the source folder is unzipped as well, and put the entire folder in your provider. The entire folder means the folder with the textures and source folder within it. You must respect that hierarchy or Minsar will not find the way to the files.

Download the nice animated dragon

1.1. If you don't want / don't know how to animate an object, you have got plenty of 3D providers on which you can find some animated models. In our case, we will go on Sketchfab. In the menu, click "Explore".



1.2. A drop-down menu will appear under "Explore". Choose "Downloadable".



1.3. Left-Click on "This Week" to remove that filter and have access to more choices.



1.4. By clicking on "Categories" on the top right corner, you can filter the models by type.



1.5. In our case we have a specific idea in mind. Left-Click into the Search bar, type "dragon", and tick the options "Downloadable" and "Animated". In the vignettes, you can spot our dragon. Left-Click on it.



1.6. On the dragon page, click "Download 3D model".



1.7. The download window appears, asking you the format you want for your dragon. Choose ".fbx". Indeed, using the Sketchfab autoconversion for gltf, especially for an animated model, is too risky. It is better to do it ourselves. Download your dragon and save it wherever you like on your computer.



Check the textures of your dragon

2.1. The first thing to do, when you download an object from Sketchfab, is to check the size of its textures. Navigate to your dragon, into the "Textures" folder.



2.2. In our case, we can guess by the name of the textures that we will only be interested in the first two, which are related to the dragon and not to the floor of the scene. In this case, we have a color map, and a normal map. For each one of them, Right-Click on it and go to Properties.



2.3. In the Properties window, go to "Details". There, you can see the dimensions of your texture. Here, it is 4096 x 4096 pixels. In most cases, this will be too much to process in Minsar, so you will have to reduce it. To do that, you can follow our Texture Reduction guide. Once you are done, come back here :)



Prepare your dragon for Minsar

We will now prepare our dragon for Minsar, by tweaking it a bit in Blender.

3.1. If you don't have Blender, go and download the latest version (2.80) on Blender website. Install it on your computer and then launch it.



3.2. When you first launch Blender, you will have a welcome page. Left-click anywhere in the window to close it.



3.3. Let's import our dragon. Go to "File/Import.../FBX". Navigate to your dragon folder, into "Sources" and download the model.



Unzipping your model

In some cases, you need to unzip the model in the "Sources" folder that came with your dragon. Before trying to import it in Blender, make sure it is unzipped :)

3.4. You should have something like this.



3.5. We are going to start by cleaning the scene and only keeping our dragon. On the top right corner of the window, you have a smaller window which is called the "Outliner". Inside it, you have the list of all the objects of your scene. Select everything but "Dragon Idle" by Shift + Left-Clicking on each element.



3.6. Hover your mouse over the main window where you can see your dragon, then hit "Delete" on your keyboard to delete the elements.

3.7. Now, Left-Click on the small arrow next to "Dragon Idle". You can see that there are other objects parented to it. Indeed, the small humanoid icon next to Dragon Idle means that it is an armature, that is to say a set of bones which are applied to the mesh in order to animate it. If you look within the list attached to the Dragon Idle, you will see the actual mesh, symbolized by an orange triangle.



3.8. In order for the animation to work, it is wise to check that there are no Transform anomalies before exporting it, that is to say to make sure that all the elements we are going to export have a rotation, scale and location to 0. To do that, start by clicking on the armature. Just beside the main window, you have a set of panels. One of them is called "Item". Click on it to open the panel in question, if it's not already open. In there, you will see a Transform section. Check that the Location, Rotation values are at 0, and the Scale values are at 1.000.



3.9. In our case, we can see that there is a -90° rotation on the X axis. To correct this, hover your mouse over your dragon window and type Ctrl + A, then select "All Transforms". That's it, now everything is at zero. Select your mesh in the outliner and do the exact same thing.



Check if the model is still well animated

The operation we just did is called "Freeze Transformation". In some cases, it might mess up your model and animation. If, once you have frozen the transformation, you see a change in your model (if its location or rotation looks different), then hit Ctrl+Z and don't try to change its coordinates anymore. To check if the animation still looks right, click on the Play button below the main window.



4.1. Now we need to attach the reduced textures (see Section 2 Check the textures of your dragon). In the "Outliner", select your mesh.



4.2. Go to the "Material" panel.



4.3. In the list of materials attached to the object, you have three materials. Select each one of them and delete them by clicking on the "-" button beside.



4.4. When the list is empty, create a new material by clicking on the "New" button.



4.5. Hover your mouse over the junction between the main window where you can see your dragon, and the window just below. Click on it, don't release the click button, and drag the window up to expand it.



4.6. On the very top left corner of that second window, click on the clock icon. In the drop-down menu, choose "Shader Editor".



4.7. You can now see the Shader Editor. Basically, it shows you what the material of your object is made of. You can see two boxes, which are called "Nodes". The first one is called the "Principled BSDF" node. This is our material, to which we are going to plug the textures of our object. As you can see, the "Principled BSDF" node is connected to the "Surface" input of the "Material Output" node. This node is extremely important because it is the final node which actually attaches the material to your object.



4.8. Let's plug in our textures! Open an explorer window beside your Blender one, and navigate to the folder where you put your reduced textures (see Section 2 Check the textures of your dragon). If you have followed the tutorial to the letter and haven't moved the reduced textures after the reduction, they should still be in the "Input" folder of the Texture Reduction tool. From there, select your textures and drag and drop them directly into the Shader Editor.



One by one

You might be tempted to select both your textures and drop them in Blender, but unfortunately, you will have to do it one by one ;)

4.9. Here you go, you now have two more nodes into your Shader Editor. Start by connecting the Color. On the top right corner of the node, you can see the output "Color". Right next to it, there is a little yellow dot. Click on it, don't release your click, and drag your mouse towards the right. You will see a little white string being drawn out of the output. Bring it all the way to the "Base Color" input of the "Principled BSDF" node.



4.10. Now connect the "Normal" map, which will give your dragon its relief and details. Connect the "Color" output to the "Normal" input of the "Principled BSDF" node, and set the color space to "Non-Color".



4.11. To see the result, activate the render, by clicking on the "Look Dev" option, on the top right corner of the main window. Keep in mind that Blender 2.80 still have some render bugs, so don't worry if the shading of your object looks weird, it will look better in Minsar :)



Export your dragon for Minsar

Now, we are ready to export our dragon. At the time we are writing this tutorial, you have two options for this. The first one is faster, but heavier in terms of performance cost. The second one is a bit longer but safer. The reason for these two methods is that the glTF animation and export process is very new and still under development. As a result, we have noticed some bugs in the export process, that is why we designed two specific ways to avoid problems.

First method: export in .glb with animation samples

5.1. In the "Outliner", select first the mesh, second the armature. Your dragon should be outlined in orange, and the armature (the bones) should be outlined in yellow.



5.2. Go to "File/Export/glTF 2.0".



5.3. In the export options, you have a small panel on the lower left side. In the General tab, tick Selected Objects. Select glTF binary.



5.4. Go to the Animation tab, and tick the Always Sample Animations option.



5.5. Choose a folder to export your dragon, and then hit "Export glTF 2.0".

If your dragon doesn't work through the first method

If your dragon still can't be imported in Minsar after you exported it through the first method, then try the second one.

Second method: export through FBX

The second method is going to seem weird but it works: we need to export the model back into ".fbx", then re-import it and export it in ".glb". Hang in there, it is not as bad as it reads!

5.1. In the "Outliner", select first the mesh, second the armature. Your dragon should be outlined in orange, and the armature (the bones) should be outlined in yellow.



5.2. Go to "File/Export/FBX".



5.3. In the "Main" tab of the export options, tick the "Selected Objects" option. Then "Shift-Click" on "Armat" and "Mesh", so that you export only the mesh and its animation, and nothing else that could linger in the scene.



5.4. Choose an export location, and hit "Export FBX".



Safety options

For more safety, or if you encounter problems in Minsar, you can also uncheck the "Add Leaf Bones" in the "Armatures" tab, as well as "NLA Strips" under the "Animation" tab.







5.5. Save your Blender file by going to "File/Save As..."

5.6. Create a new scene, by going to "File/New".

5.7. Import the .fbx dragon you have just exported by going to "File/Import.../Fbx".

5.8. In the "Outliner", select first the mesh, second the armature. Your dragon should be outlined in orange, and the armature (the bones) should be outlined in yellow.



5.9. Go to "File/Export/glTF 2.0".

5.10. In the Export options, make sure you check the "Selected Objects" option, and that you choose the ".glb" format. Then hit "Export glTF 2.0" after choosing your export destination.



Congratulations!!

Your animated model is now ready to be imported in Minsar!

Loading time

An animated model can be heavy to process into Minsar, whether you have exported with samples or not. For this reason, don't worry if your dragon takes a long time to be imported in Minsar. Your screen might even freeze for a while, but be patient, it will come around eventually :) If you have no error, or if Minsar doesn't crash leaving you to the desktop, wait a bit longer.