glTF importer: avoid crash on invalid glTF file with multiple same target path animation

This commit is contained in:
Julien Duroure 2019-11-13 22:37:56 +01:00
parent 2b04a1ab68
commit 9189c45958
2 changed files with 6 additions and 2 deletions

View File

@ -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',

View File

@ -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: