[Bf-extensions-cvs] [2d691e2e] master: glTF importer: Ignore animation import if target has no node
Julien Duroure
noreply at git.blender.org
Wed Jun 5 19:06:12 CEST 2019
Commit: 2d691e2e0c46b3d91b491cfeda94523c1517a085
Author: Julien Duroure
Date: Wed Jun 5 19:05:23 2019 +0200
Branches: master
https://developer.blender.org/rBA2d691e2e0c46b3d91b491cfeda94523c1517a085
glTF importer: Ignore animation import if target has no node
===================================================================
M io_scene_gltf2/__init__.py
M io_scene_gltf2/blender/imp/gltf2_blender_gltf.py
===================================================================
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)
More information about the Bf-extensions-cvs
mailing list