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>2015-04-26 15:47:40 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-04-26 15:47:40 +0300
commit3b6028fd8b895dcc42b23e481fd8d99c10553acd (patch)
tree94fad681f1f60bb012bc3cc5bdbf4a4031914b92
parentbd9fa8054318f513500bc93316b64421b0f0d3fc (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.
-rw-r--r--io_scene_fbx/__init__.py6
-rw-r--r--io_scene_fbx/export_fbx_bin.py16
2 files changed, 10 insertions, 12 deletions
diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index 9b030569..f3865fb4 100644
--- a/io_scene_fbx/__init__.py
+++ b/io_scene_fbx/__init__.py
@@ -21,7 +21,7 @@
bl_info = {
"name": "FBX format",
"author": "Campbell Barton, Bastien Montagne, Jens Restemeier",
- "version": (3, 2, 3),
+ "version": (3, 2, 4),
"blender": (2, 74, 0),
"location": "File > Import-Export",
"description": "FBX IO meshes, UV's, vertex colors, materials, "
@@ -346,7 +346,9 @@ class ExportFBX(bpy.types.Operator, ExportHelper, IOFBXOrientationHelper):
)
bake_anim_use_all_actions = BoolProperty(
name="All Actions",
- description="Export each action as a separated FBX's AnimStack, instead of global scene animation",
+ description="Export each action as a separated FBX's AnimStack, instead of global scene animation "
+ "(note that animated objects will get all actions compatible with them, "
+ "others will get no animation at all)",
default=True,
)
bake_anim_step = FloatProperty(
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)