diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-04-26 15:47:40 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-04-26 15:47:40 +0300 |
commit | 3b6028fd8b895dcc42b23e481fd8d99c10553acd (patch) | |
tree | 94fad681f1f60bb012bc3cc5bdbf4a4031914b92 /io_scene_fbx/export_fbx_bin.py | |
parent | bd9fa8054318f513500bc93316b64421b0f0d3fc (diff) |
Fix T44386: FBX export with 'all actions' enabled was a bit too much enthusiast.
It would export animations from all compatible actions - even for objects that were
actually not animated at all! This would lead to undesired behavior esp. for
simple objects scenes with only one or two animated.
Now we only export all compatible actions for a given object if it is actually
animated.
Diffstat (limited to 'io_scene_fbx/export_fbx_bin.py')
-rw-r--r-- | io_scene_fbx/export_fbx_bin.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py index 95aebbd8..e54af834 100644 --- a/io_scene_fbx/export_fbx_bin.py +++ b/io_scene_fbx/export_fbx_bin.py @@ -2010,17 +2010,16 @@ def fbx_animations(scene_data): ob = ob_obj.bdata # Back to real Blender Object. + if not ob.animation_data: + continue # Do not export animations for objects that are absolutely not animated, see T44386. + # We can't play with animdata and actions and get back to org state easily. # So we have to add a temp copy of the object to the scene, animate it, and remove it... :/ ob_copy = ob.copy() # Great, have to handle bones as well if needed... pbones_matrices = [pbo.matrix_basis.copy() for pbo in ob.pose.bones] if ob.type == 'ARMATURE' else ... - if ob.animation_data: - org_act = ob.animation_data.action - else: - org_act = ... - ob.animation_data_create() + org_act = ob.animation_data.action path_resolve = ob.path_resolve for act in bpy.data.actions: @@ -2036,16 +2035,13 @@ def fbx_animations(scene_data): if pbones_matrices is not ...: for pbo, mat in zip(ob.pose.bones, pbones_matrices): pbo.matrix_basis = mat.copy() - ob.animation_data.action = None if org_act is ... else org_act + ob.animation_data.action = org_act restore_object(ob, ob_copy) if pbones_matrices is not ...: for pbo, mat in zip(ob.pose.bones, pbones_matrices): pbo.matrix_basis = mat.copy() - if org_act is ...: - ob.animation_data_clear() - else: - ob.animation_data.action = org_act + ob.animation_data.action = org_act bpy.data.objects.remove(ob_copy) |