Polygonal Mind
  • Home
  • Metaverse Builder
  • CryptoAvatars
  • MegaCube
  • Blog
  • Decentraland
  • Projects
  • Assets

Blog

Export a GLTF/GLB with several animations

4/29/2021

2 Comments

 
The Mission
As we advance with new projects in Decentraland. We learn new tecniques and new softwares.

One of the ones we have been use the most lately is Blender, since you can export GLTF and GLB formats really well. We have talked about animating in Blender in other posts.
​
So here is a mini guide to export a GLTF model with several animations attached. So you can alternate between them in a GLTF viewer of your choice.
Resources
  • Blender 2.9
  • GLTF/GLB viewer
Export a GLTF/GLB with several animations
Stash animations

So the first thing you need to know to create different animations in Blender, is what are the actions? How to create one? How they work? and How do you delete them?

An Action in Blnder is a tool to record and contain the data. As everything else in Blender, Actions are data-blocks. So when you animate an object by changing its location with keyframes, the animation is saved to the Action. That way you can create as many animations as actions you want.
​
Each Animation could be a different action on the character or object. For example run, iddle, shoot....
To create a new action, you will have to change one of the windows of Blender or create a new one. To do that, move your cursor into one of the corners of the window, until the cursor changes the icon into a cross, then click and drag to create a window.
position to create a new window
Cursor and position to create a new window
Then to view the action menu, change the content of the page to the Dope Sheet and then you can change it to the Action Editor.
Dope Sheet Action Editor
Changing the window to dope sheet
Dope Sheet Action Editor
Menu to change to the Action Editor
When you have the editor in view, you can start creating actions, but before you do that, you must have a couple of things in mind:
​
  • Actions only can be vinculed to ONE object, if your model is divided in two pieces you can't assign the same action to them.
  • In order to avoid the above point, the actions shall be vinculed to the Armature. In Blender an armature is similar to and empty group, which is the parent of the model and the bones.
  • As you can imagine because of the term, armature is related to bones, and that is correct. When you create an Armature, it automatically creates a bone and they are vinculed. In that way when you animate in the Armature the bones are afected too
  • And finally, Yes, that means that the models shall be animated with bones.

Once you have created and armature (Top corner Add→Armature), you are ready to create actions. With the Armature selected, press the New button, change the name of the animation and don't forget to press the shield (If you do not press the shield, Blender will not save the new name, and you will lose the changes you do with the action).
armature new action
With the armature Selected create a new action
When you finish with the action, close it by pressing the X button at the right, so you access to the first menu on the editor and create a new one from scratch. An Important note if you want to delete the action because you don't like it, don't need it or if you duplicate it by mistake, DON'T press the X button alone (as stated before this closes the action but it doesn't delete it) and DON'T press the delete key nor the backspace one this won´t delete it either.
​
The ONLY way to delete it is to press Shift + the X button on the right, then close and reopen the file to refresh the motor, if you do not close the program you will still see the actions that you deleted.
save the name and the action
Check the shield to save the name and the action 
save the name and the action
Check the shield to save the name and the action 
Once you have finished with whichever actions you want to make, you have to stash them on the model, to make them selectable in the gltf model. To do that presh the stash button in the left side of the action editor, make sure you dont want to edit anymore before stashing it.
save the name and the action
Menu with different actions
From Maya To Blender

Now let's say, that you want to work in another software like Maya, This time the change is easy, but you have to follow a series of steps.
  1. Do the animations with bones, when you sport them into blender will create an Armature
  2. Make sure all the animations are in the same time line, you can separate the frames to divide the animations, but make them on the same time line.
  3. Export in FBX with the bones and check in the options Bake Animation
​
Once you import to blender; the fbx will create an armature in the scene with the animations in it. Then all you have to do is :
  1. rename the action.
  2. Duplicate the action as many times as animations you did
  3. Delete the frames that you don't need and move the ones you need to the start of the timeline
  4. once you do this stash the animations and export the model
Exporting and Viewing

When you export the model, check a few options in the presets:
  • Limit to selected Objects, if you have several objects on the scene make sure you select everything inside the armature you want to export
  • Apply modifiers to apply the deformation of the Bones to the models
  • In the animation → skinning → include all bones influences to make sure all the bones are exported
​
Once you export it, you can see the model and check is correct in a GLTF/GLB viewer there are several online that you can see, when you import the model make sure that you have an a tab where you can check whic animation you want to see.
Exporting and Viewing
GLTF/GLB viewer
Web with the different animations to select

Picture
Laura Usón
​​​3D ARTIST
​Passionate about videogames, movies and creatures. artist by day and superhero at night.
cent
2 Comments
Paw Oo
11/4/2021 10:58:50 pm

Hello! I have some issue. That the wearable is invisible/the whole torso disappear when I preview in DCL editor. How can I solve it.

Reply
Jassy espresso machine link
11/6/2021 01:18:54 am

Every morning, coffee is how I start my day. It warms my bones up on the drive to work and it gives me some extra energy to get things done during the day. My favorite part of starting my day is that second jolt after I pour the hot liquid into a mug, wait for that beautiful brown foam on top, stir in some cream, and take a sip. But there are mornings when coffee runs out which wrecks all of the plans perfectly laid out for this great start to my day - or days lead right into one another without any time if coffee restock. More often than not these are also times when blending cold ingredients with hot water doesn’t fit with what you need in your life or tastes like cheap

Reply



Leave a Reply.

    Categories

    All
    Blender
    CryptoAvatars
    Decentraland
    Decentraland En Español
    Maya
    Metaverse
    Mixamo
    Morphite
    Substance Painter
    The Sandbox
    Totally Reliable Delivery Service
    Unity 3D
    Updates
    Vrchat

    Archives

    March 2022
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    October 2020
    August 2020
    July 2020
    June 2020
    May 2020
    April 2020
    March 2020
    February 2020
    December 2019
    October 2019
    September 2019
    August 2019
    June 2019
    May 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2016

    Picture
Home
Projects
Assets

Picture
Crypto
Friendly
Picture

Subscribe to get some 💚 in your inbox once in a while.

Follow us and your visit will never be forgotten!
Picture
Picture
Picture

 © 2015-2022 POLYGONAL MIND LTD. ALL RIGHTS RESERVED.
  • Home
  • Metaverse Builder
  • CryptoAvatars
  • MegaCube
  • Blog
  • Decentraland
  • Projects
  • Assets