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>2016-06-10 16:54:49 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-06-10 16:54:49 +0300
commitc4a79435e45610d50dadfacf2ed2c09ce595f70f (patch)
tree0c2634603c89ae608dcd2c80776dc4cfbf2fddb2
parentc82bb571dcbbc3a09e941d01688d2bfd53413e91 (diff)
Fix T48631: FBX setting "bake_anim_use_nla_strips": True, fails to export unique animations to each take.
Active action of object's animdata would override actual NLA's strip animation...
-rw-r--r--io_scene_fbx/export_fbx_bin.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py
index 98cc265d..831426d6 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -1992,6 +1992,7 @@ def fbx_animations(scene_data):
# Per-NLA strip animstacks.
if scene_data.settings.bake_anim_use_nla_strips:
strips = []
+ ob_actions = []
for ob_obj in scene_data.objects:
# NLA tracks only for objects, not bones!
if not ob_obj.is_object:
@@ -1999,6 +2000,9 @@ def fbx_animations(scene_data):
ob = ob_obj.bdata # Back to real Blender Object.
if not ob.animation_data:
continue
+ # We have to remove active action from objects, it overwrites strips actions otherwise...
+ ob_actions.append((ob, ob.animation_data.action))
+ ob.animation_data.action = None
for track in ob.animation_data.nla_tracks:
if track.mute:
continue
@@ -2017,6 +2021,9 @@ def fbx_animations(scene_data):
for strip in strips:
strip.mute = False
+ for ob, ob_act in ob_actions:
+ ob.animation_data.action = ob_act
+
# All actions.
if scene_data.settings.bake_anim_use_all_actions:
def validate_actions(act, path_resolve):