Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2021-01-17 11:36:51 +0300
committerJulien Duroure <julien.duroure@gmail.com>2021-01-17 11:36:51 +0300
commitd7f8d9a4f919894b23ee855d3b1a2327222de468 (patch)
tree2d9a7b575a992758878c87dbc5f4631184b1e922
parent03fd6c5a3fb9df9dc5835f497149149830be6da4 (diff)
glTF importer: make NLA track order match glTF animation order
-rwxr-xr-xio_scene_gltf2/__init__.py2
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_scene.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 5cde29d2..27a9e61e 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -15,7 +15,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
- "version": (1, 5, 13),
+ "version": (1, 5, 14),
'blender': (2, 91, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
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