diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2020-09-05 16:29:05 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2020-09-05 16:29:05 +0300 |
commit | 5ebb907bf7e2a9eadf4e066967be2a4349ab464b (patch) | |
tree | b1aaa70666a0f6c36aeaab05d4b6a1dfd279f6f1 /io_scene_gltf2/blender | |
parent | ee912f6fd22baaa94f925ac9dff5f9ccdbb2ecbd (diff) |
glTF importer: refactor: use action_group parameter to fcurves.new
Diffstat (limited to 'io_scene_gltf2/blender')
-rw-r--r-- | io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py | 10 |
1 files changed, 2 insertions, 8 deletions
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 2d0d8568..c45e7f7d 100644 --- a/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py @@ -45,19 +45,13 @@ 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): +def make_fcurve(action, co, data_path, index=0, group_name='', interpolation=None): try: - fcurve = action.fcurves.new(data_path=data_path, index=index) + fcurve = action.fcurves.new(data_path=data_path, index=index, action_group=group_name) except: # Some non valid files can have multiple target path return None - if group_name: - if group_name not in action.groups: - action.groups.new(group_name) - group = action.groups[group_name] - fcurve.group = group - fcurve.keyframe_points.add(len(co) // 2) fcurve.keyframe_points.foreach_set('co', co) |