diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2021-01-17 11:36:51 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2021-01-17 11:36:51 +0300 |
commit | d7f8d9a4f919894b23ee855d3b1a2327222de468 (patch) | |
tree | 2d9a7b575a992758878c87dbc5f4631184b1e922 /io_scene_gltf2/blender | |
parent | 03fd6c5a3fb9df9dc5835f497149149830be6da4 (diff) |
glTF importer: make NLA track order match glTF animation order
Diffstat (limited to 'io_scene_gltf2/blender')
-rwxr-xr-x | io_scene_gltf2/blender/imp/gltf2_blender_scene.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_scene.py b/io_scene_gltf2/blender/imp/gltf2_blender_scene.py index e6eadcd6..1a276960 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_scene.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_scene.py @@ -50,7 +50,9 @@ class BlenderScene(): def create_animations(gltf): """Create animations.""" if gltf.data.animations: - for anim_idx, _anim in enumerate(gltf.data.animations): + # NLA tracks are added bottom to top, so create animations in + # reverse so the first winds up on top + for anim_idx in reversed(range(len(gltf.data.animations))): BlenderAnimation.anim(gltf, anim_idx) # Restore first animation |