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:
authorBastien Montagne <montagne29@wanadoo.fr>2014-09-19 16:31:17 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-09-19 16:31:17 +0400
commitf7ef101d09b0bdb34f88629f0feab5af6d274b43 (patch)
treeaa7d2430f39b50aabe6191b92f51300115b577d5 /io_scene_fbx/fbx_utils.py
parentaeb4cb010eb497e3c511edcad05e8d8831a1ca12 (diff)
Fix T41766: FBX (binary) exporter does not export actions with one frame animations.
When we are exporting actions or strips from NLA, and an evaluated anim leads to no anim at all (like single-keyed actions or pure static ones), key all start and end frames. Note this might be overkill (due to baked anim, we will key *all* transform channels), but probably better than skipping completely those actions!
Diffstat (limited to 'io_scene_fbx/fbx_utils.py')
-rw-r--r--io_scene_fbx/fbx_utils.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/io_scene_fbx/fbx_utils.py b/io_scene_fbx/fbx_utils.py
index b751025c..e3218699 100644
--- a/io_scene_fbx/fbx_utils.py
+++ b/io_scene_fbx/fbx_utils.py
@@ -679,7 +679,7 @@ class AnimationCurveNodeWrapper:
assert(len(values) == len(self.fbx_props[0]))
self._keys.append((frame, values, [True] * len(values))) # write everything by default.
- def simplfy(self, fac, step):
+ def simplfy(self, fac, step, force_keep=False):
"""
Simplifies sampled curves by only enabling samples when:
* their values differ significantly from the previous sample ones, or
@@ -726,6 +726,12 @@ class AnimationCurveNodeWrapper:
p_keyed[idx] = (currframe, val)
are_keyed[idx] = True
p_currframe, p_key, p_key_write = currframe, key, key_write
+
+ # If we write nothing (action doing nothing) and are in 'force_keep' mode, we key everything! :P
+ # See T41766.
+ if (force_keep and not self):
+ are_keyed[:] = [True] * len(are_keyed)
+
# If we did key something, ensure first and last sampled values are keyed as well.
for idx, is_keyed in enumerate(are_keyed):
if is_keyed: