[Bf-extensions-cvs] [5ebb907b] master: glTF importer: refactor: use action_group parameter to fcurves.new

Julien Duroure noreply at git.blender.org
Sat Sep 5 15:29:12 CEST 2020


Commit: 5ebb907bf7e2a9eadf4e066967be2a4349ab464b
Author: Julien Duroure
Date:   Sat Sep 5 15:29:05 2020 +0200
Branches: master
https://developer.blender.org/rBA5ebb907bf7e2a9eadf4e066967be2a4349ab464b

glTF importer: refactor: use action_group parameter to fcurves.new

===================================================================

M	io_scene_gltf2/__init__.py
M	io_scene_gltf2/blender/imp/gltf2_blender_animation_utils.py

===================================================================

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 09c52ce8..68564a2c 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, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
-    "version": (1, 4, 13),
+    "version": (1, 4, 14),
     'blender': (2, 90, 0),
     '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 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)



More information about the Bf-extensions-cvs mailing list