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:
authorPhilipp Oeser <info@graphics-engineer.com>2021-11-19 14:19:51 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-11-23 11:37:43 +0300
commit0521e90f2d7769510b9ce0ececdc1baf9cc9ca52 (patch)
tree1e7b76b20167c6b21a08e15fc6b9e2255074aa3f
parent2fe7db71710f0f1c53f590b1d75654121e32523b (diff)
Fix T93209: FBX export error if there is an action in NLA tweakmode
Code tried to set the action to None, but in this case, the action is read-only. If we find such a case, now set tweakmode to False temporarily and restore after actions have been processed. Maniphest Tasks: T93209 Differential Revision: https://developer.blender.org/D13286
-rw-r--r--io_scene_fbx/__init__.py2
-rw-r--r--io_scene_fbx/export_fbx_bin.py11
2 files changed, 10 insertions, 3 deletions
diff --git a/io_scene_fbx/__init__.py b/io_scene_fbx/__init__.py
index 01bc5421..a13d318f 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": (4, 23, 0),
+ "version": (4, 23, 1),
"blender": (2, 90, 0),
"location": "File > Import-Export",
"description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions",
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py
index 65a5b8f1..6eb485c3 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -2088,8 +2088,14 @@ def fbx_animations(scene_data):
ob = ob_obj.bdata # Back to real Blender Object.
if not ob.animation_data:
continue
+
+ # Some actions are read-only, one cause is being in NLA tweakmode
+ restore_use_tweak_mode = ob.animation_data.use_tweak_mode
+ if ob.animation_data.is_property_readonly('action'):
+ ob.animation_data.use_tweak_mode = False
+
# We have to remove active action from objects, it overwrites strips actions otherwise...
- ob_actions.append((ob, ob.animation_data.action))
+ ob_actions.append((ob, ob.animation_data.action, restore_use_tweak_mode))
ob.animation_data.action = None
for track in ob.animation_data.nla_tracks:
if track.mute:
@@ -2110,8 +2116,9 @@ def fbx_animations(scene_data):
for strip in strips:
strip.mute = False
- for ob, ob_act in ob_actions:
+ for ob, ob_act, restore_use_tweak_mode in ob_actions:
ob.animation_data.action = ob_act
+ ob.animation_data.use_tweak_mode = restore_use_tweak_mode
# All actions.
if scene_data.settings.bake_anim_use_all_actions: