Skip to content
Snippets Groups Projects
Commit 2d691e2e authored by Julien Duroure's avatar Julien Duroure
Browse files

glTF importer: Ignore animation import if target has no node

parent a84dac69
No related branches found
No related tags found
No related merge requests found
......@@ -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',
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment