How to import ".glTF" animations in Minsar Studio¶
Minsar Studio 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 especially 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 Studio 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 Studio supports only Transform and Armature / Bones animations. Blendshapes or vertex animations will not be read.
-
You must have one animation set per object, although this animation set can itself hold several animation clips (walk, run, jump, etc.). 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 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 Studio¶
To be sure your animation will be read correctly in Minsar Studio, 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 Studio 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 AR cases, this will be too much to process in Minsar Studio, 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 Studio¶
We will now prepare our dragon for Minsar Studio, by tweaking it a bit in Blender.
3.1. If you don't have Blender, go and download the latest version 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 Studio :)
Export your dragon for Minsar Studio¶
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. Choose a folder to export your dragon, and then hit "Export glTF 2.0".
Congratulations!!
Your animated model is now ready to be imported in Minsar Studio!
Loading time
An animated model can be heavy to process into Minsar Studio, 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 Studio. Your screen might even freeze for a while, but be patient, it will come around eventually :) If you have no error, or if Minsar Studio doesn't crash leaving you to the desktop, wait a bit longer.