diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-06-05 20:05:23 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-06-05 20:05:23 +0300 |
commit | 2d691e2e0c46b3d91b491cfeda94523c1517a085 (patch) | |
tree | 51ac1e360738a31c3f998751eace8fb54ef4a079 /io_scene_gltf2 | |
parent | a84dac69bc9d0b78b1cadd12a39cacc16a4eabe3 (diff) |
glTF importer: Ignore animation import if target has no node
Diffstat (limited to 'io_scene_gltf2')
-rwxr-xr-x | io_scene_gltf2/__init__.py | 2 | ||||
-rwxr-xr-x | io_scene_gltf2/blender/imp/gltf2_blender_gltf.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py index 3d574f7d..ba8b750e 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, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', - "version": (0, 9, 22), + "version": (0, 9, 23), 'blender': (2, 80, 0), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py b/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py index b03b56bd..53b200b2 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py @@ -258,6 +258,9 @@ class BlenderGlTF(): for anim_idx, anim in enumerate(gltf.data.animations): for channel_idx, channel in enumerate(anim.channels): + if channel.target.node is None: + continue + if anim_idx not in gltf.data.nodes[channel.target.node].animations.keys(): gltf.data.nodes[channel.target.node].animations[anim_idx] = [] gltf.data.nodes[channel.target.node].animations[anim_idx].append(channel_idx) |