summaryrefslogtreecommitdiffstats
path: root/modules/gltf
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-04-11 14:18:35 +0200
committerGitHub <noreply@github.com>2022-04-11 14:18:35 +0200
commit4ab86c6731a0a27f054998c51daf15be3b90db15 (patch)
tree65c82f2de4f601931bc89cb3e6b89c991f2464c4 /modules/gltf
parent5613ac37d658820fd0e4c3162f24a3b68414d3f9 (diff)
parent6f401439f849c0c99d8455c607fdef28750ee889 (diff)
downloadredot-engine-4ab86c6731a0a27f054998c51daf15be3b90db15.tar.gz
Merge pull request #59980 from reduz/animation-libraries
Diffstat (limited to 'modules/gltf')
-rw-r--r--modules/gltf/gltf_document.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index 36681698a1..73222330db 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -6095,7 +6095,14 @@ void GLTFDocument::_import_animation(Ref<GLTFState> state, AnimationPlayer *ap,
animation->set_length(length);
- ap->add_animation(name, animation);
+ Ref<AnimationLibrary> library;
+ if (!ap->has_animation_library("")) {
+ library.instantiate();
+ ap->add_animation_library("", library);
+ } else {
+ library = ap->get_animation_library("");
+ }
+ library->add_animation(name, animation);
}
void GLTFDocument::_convert_mesh_instances(Ref<GLTFState> state) {