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:
authorDalai Felinto <dfelinto@gmail.com>2019-02-28 18:43:26 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-02-28 18:45:51 +0300
commit96a51679699c75e1a08f2d91b2b055bf6430e9d1 (patch)
tree6b38768e0d97fea051dcf9ad53809a2d88de5e55 /io_scene_fbx
parent5e6515149f47b2aae9a356eb2744170d8b3acbb8 (diff)
FBX Exporter: Support special case of constant interpolation
If all the keyframes were set to constant interpolation. Reviewers: mont29 Differential Revision: https://developer.blender.org/D4429
Diffstat (limited to 'io_scene_fbx')
-rw-r--r--io_scene_fbx/export_fbx_bin.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py
index 5ecc8706..63d67d4a 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -1706,11 +1706,18 @@ def fbx_data_animation_elements(root, scene_data):
acurve.add_string(fbx_name_class(b"", b"AnimCurve"))
acurve.add_string(b"")
+ # special case, if all keys are constant, set const interpolation mode
+ constant = True
+ for key in keys:
+ if key.interpolation != 'CONSTANT':
+ constant = False
+ break
+
# key attributes...
nbr_keys = len(keys)
# flags...
keyattr_flags = (
- 1 << 2 | # interpolation mode, 1 = constant, 2 = linear, 3 = cubic.
+ 1 << (1 if constant else 2) | # interpolation mode, 1 = constant, 2 = linear, 3 = cubic.
1 << 8 | # tangent mode, 8 = auto, 9 = TCB, 10 = user, 11 = generic break,
1 << 13 | # tangent mode, 12 = generic clamp, 13 = generic time independent,
1 << 14 | # tangent mode, 13 + 14 = generic clamp progressive.