How to add multiple skeletal animations to a single 3D model in Blender for subsequent export to Godot?
Adding Multiple Skeletal Animations to a Single 3D Model in Blender for Export to Godot
To add multiple skeletal animations to a single 3D model in Blender for export to Godot, you need to create separate Actions for each animation in the Animation Editor, then configure the export using the Godot Blender Exporter with the “Include All Actions” option, and properly import the file in Godot with the appropriate animation settings.
Table of Contents
- Model and Skeleton Preparation
- Creating Multiple Animations in Blender
- Setting Up Export to Godot
- Importing and Using Animations in Godot
- Solving Common Problems
Model and Skeleton Preparation
Before adding animations, ensure your model is fully ready:
-
Check vertex weights: Make sure all vertices of your model are properly weighted to the skeleton bones. Use Edit mode and select bones to verify that vertices recolor correctly.
-
Object center: Set the object center to the character’s base position (usually at the center of the feet or hips). This is important for proper animation functionality in Godot.
-
Bone hierarchy: Verify that the bone hierarchy is properly set up with a single root bone (typically called “root” or “hip”).
-
Scale normalization: Ensure your model has the correct scale. Godot works better with models at 1:1 scale.
Important: All animations must be created for the same Armature with identical bone structure. Changing the bone structure between animations will cause export errors.
Creating Multiple Animations in Blender
To create multiple animations for a single model, follow these steps:
Basic Animation Setup
- Switch to Animation mode in Blender
- Make sure your Armature is selected
- In the Dope Sheet window, select Action Editor
Creating the First Animation
- Click New to create a new Action
- Give it a descriptive name, such as “idle”, “walk”, “run”
- Set the animation time range in the timeline
- Create keyframes for the desired poses and movements
- Repeat the process for each animation
Organizing Animations
# Example of naming Actions in Blender
"idle_loop" # Looping idle
"walk_forward" # Walking forward
"run_forward" # Running forward
"jump" # Jump
"attack_sword" # Sword attack
Tip: Use prefixes to group animations (e.g., “loop_”, “once_”, “combat_”) for easier management in Godot.
Optimizing Animations
- Remove redundant keyframes: Use Clean Keyframes to remove unnecessary keyframes
- Trimming: Ensure each animation starts and ends in the proper pose
- Interpolation: Adjust keyframe interpolation types for smooth movements
Setting Up Export to Godot
To properly export animations, use the Godot Blender Exporter:
Exporter Installation
- Download the latest version of Godot Blender Exporter
- Install it in Blender via Preferences > Add-ons
- Activate the Godot exporter
Export Settings
- Select your model in Blender
- Go to File > Export > Godot GLTF (.glb/.gltf)
- Configure the following parameters:
| Parameter | Recommended Value | Description |
|---|---|---|
| Include Actions | ✅ Enable | Exports all animation actions |
| Animation Mode | ||
| - Loop | ✅ For looping animations | |
| - Root Bone | Root bone | Usually “root” or “hip” |
| - FPS | 30 or 60 | Animation speed |
| - Compress** | ✅ Enable | Reduces file size |
Export Format
Recommended formats:
- .glb (binary, better for Godot)
- .gltf + .bin (if separation is needed)
Compression settings:
- Draco Compression: ✅ for models
- Mesh Quantization: ✅ for optimization
Important: Verify that all animations appear in the action list before exporting.
Importing and Using Animations in Godot
After importing the model into Godot, you need to configure the animations for use:
Model Import
- Drag the .glb file into your Godot project folder
- Select the model in the inspector
- Configure the import:
# Example import settings
[remap ani]
importer="scene"
type="PackedScene"
[remap mesh]
importer="mesh"
type="ArrayMesh"
[remap animation]
importer="animation"
type="AnimationLibrary"
Creating AnimationPlayer
- Add an AnimationPlayer node to your character
- Create an AnimationLibrary for managing animations
- Set up animation states:
# Example code for animation control
extends CharacterBody3D
@onready var animation_player = $AnimationPlayer
func _ready():
# Load animations
var animation_library = preload("character_animations.tres")
animation_player.animation_library = animation_library
# Play animation
play_animation("idle")
func play_animation(anim_name: String):
if animation_player.has_animation(anim_name):
animation_player.play(anim_name)
Setting Up Animation Blending
For smooth transitions between animations, configure blending:
# Setting up animation blending
animation_player["parameters/idle/blend_time"] = 0.2
animation_player["parameters/walk/blend_time"] = 0.3
animation_player["parameters/run/blend_time"] = 0.4
Solving Common Problems
Problem 1: Animations Not Importing
Solution:
- Check that all Actions in Blender have unique names
- Ensure the “Include Actions” option is enabled in the exporter
- Check for errors in the Godot console
Problem 2: Animations Playing Incorrectly
Solution:
- Verify keyframes in Blender
- Make sure all animations have the same loop length (for looping animations)
- Adjust keyframe interpolation types
Problem 3: Model Distorting During Animation
Solution:
- Check vertex weights with bones
- Ensure there are no conflicts in the bone hierarchy
- Verify model and bone scale
Problem 4: Animations Too Large in Size
Solution:
- Enable Draco compression in export settings
- Optimize the number of keyframes
- Use animation caching in Godot
Sources
- Official Godot Documentation - Animation System
- Blender Manual - Animation Workflows
- Godot Blender Exporter GitHub Repository
- GLTF Export Settings Guide
- Character Animation Best Practices
Conclusion
Working with multiple skeletal animations in Blender for Godot requires attention to detail at each stage:
- Preparation: Always start with a properly prepared model and skeleton
- Organization: Use a clear naming system for animations
- Export: Properly configure export parameters, especially “Include Actions”
- Import: Set up AnimationPlayer in Godot for proper animation playback
- Debugging: Regularly check animations at each stage of the pipeline
Create backups of your files and test animations at each stage. Experiment with blending and transition settings to create smooth and natural character movements.