Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2019-06-02 04:28:25 +0300
committerJulien Duroure <julien.duroure@gmail.com>2019-06-02 04:28:25 +0300
commit2f94a95d8775ca3950b026feed0015503d511e38 (patch)
tree908bb65dc533ecb652f05367f5c5f99656021327 /io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py
parente2cfe666ad05e9d08d1a24e27d558c9a5a96749d (diff)
glTF importer: fix morph anim import when bezier interpolation
Diffstat (limited to 'io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py')
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_animation_node.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py b/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py
index a1a23cca..5cdfe6c2 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_animation_node.py
@@ -172,10 +172,17 @@ class BlenderNodeAnim():
if len(prim.targets) > nb_targets:
nb_targets = len(prim.targets)
+ if animation.samplers[channel.sampler].interpolation == "CUBICSPLINE":
+ factor = 3
+ delta = len(keys)
+ else:
+ factor = 1
+ delta = 0
+
for idx, key in enumerate(keys):
for sk in range(nb_targets):
if gltf.shapekeys[sk] is not None: # Do not animate shapekeys not created
- obj.data.shape_keys.key_blocks[gltf.shapekeys[sk]].value = values[idx * nb_targets + sk][0]
+ obj.data.shape_keys.key_blocks[gltf.shapekeys[sk]].value = values[factor * idx * nb_targets + delta + sk][0]
obj.data.shape_keys.key_blocks[gltf.shapekeys[sk]].keyframe_insert(
"value",
frame=key[0] * fps,