diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-09-19 16:31:17 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-09-19 16:31:17 +0400 |
commit | f7ef101d09b0bdb34f88629f0feab5af6d274b43 (patch) | |
tree | aa7d2430f39b50aabe6191b92f51300115b577d5 /io_scene_fbx/fbx_utils.py | |
parent | aeb4cb010eb497e3c511edcad05e8d8831a1ca12 (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.py | 8 |
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: |