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>2021-09-15 18:20:43 +0300
committerJulien Duroure <julien.duroure@gmail.com>2021-09-15 18:20:43 +0300
commit45132ba0f4410e9b7126bdc0a141ffca8b801c8a (patch)
tree71e150470ac79dff4fb44cc6ca35eaf08208e80c
parentb917c64d9b1a007a96d476e37dcf60c733ffc689 (diff)
glTF exporter: fix bad check in a previous commit
-rwxr-xr-xio_scene_gltf2/__init__.py2
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 08f5cbd1..2e73930d 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, 7, 23),
+ "version": (1, 7, 24),
'blender': (2, 91, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py
index 932ea25e..df069f79 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py
@@ -317,14 +317,14 @@ def gather_keyframes(blender_object_if_armature: typing.Optional[bpy.types.Objec
# We can ignore this keyframes
# if there are some fcurve, we can keep only 2 keyframes, first and last
if blender_object_if_armature is not None:
- std = np.ptp(np.ptp([[k.value[i] for i in range(len(keyframes[0].value))] for k in keyframes], axis=0))
+ cst = all([j < 0.0001 for j in np.ptp([[k.value[i] for i in range(len(keyframes[0].value))] for k in keyframes], axis=0)])
if node_channel_is_animated is True: # fcurve on this bone for this property
# Keep animation, but keep only 2 keyframes if data are not changing
- return [keyframes[0], keyframes[-1]] if std < 0.0001 and len(keyframes) >= 2 else keyframes
+ return [keyframes[0], keyframes[-1]] if cst is True and len(keyframes) >= 2 else keyframes
else: # bone is not animated (no fcurve)
# Not keeping if not changing property
- return None if std < 0.0001 else keyframes
+ return None if cst is True else keyframes
return keyframes