diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2019-11-14 00:37:56 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2019-11-14 00:37:56 +0300 |
commit | 9189c4595844752b8a534d132eed153a8ea991e4 (patch) | |
tree | 91f84b9f336bddefc1c4df6002e67401970881a3 /io_scene_gltf2 | |
parent | 2b04a1ab68290e35978fe484778a443ee8b3b7ee (diff) |
glTF importer: avoid crash on invalid glTF file with multiple same target path animation
Diffstat (limited to 'io_scene_gltf2')
-rwxr-xr-x | io_scene_gltf2/__init__.py | 2 | ||||
-rw-r--r-- | io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py index eb7e130c..f72b94b8 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": (1, 1, 7), + "version": (1, 1, 8), 'blender': (2, 81, 6), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py b/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py index cc9c3aa1..4feed76a 100644 --- a/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py @@ -46,7 +46,11 @@ def restore_animation_on_object(obj, anim_name): obj.animation_data.action = None def make_fcurve(action, co, data_path, index=0, group_name=None, interpolation=None): - fcurve = action.fcurves.new(data_path=data_path, index=index) + try: + fcurve = action.fcurves.new(data_path=data_path, index=index) + except: + # Some non valid files can have multiple target path + return None if group_name: if group_name not in action.groups: |