[Bf-extensions-cvs] [1c5da4b] master: Fix T41238: FBX exporter corrupts model's pose.
Bastien Montagne
noreply at git.blender.org
Wed Jul 30 14:50:09 CEST 2014
Commit: 1c5da4b0b46c587de65003997e0b5bbf1aff8fff
Author: Bastien Montagne
Date: Wed Jul 30 14:48:42 2014 +0200
Branches: master
https://developer.blender.org/rBA1c5da4b0b46c587de65003997e0b5bbf1aff8fff
Fix T41238: FBX exporter corrupts model's pose.
We have to store and restore pbones' matrices as well when baking animations...
===================================================================
M io_scene_fbx/export_fbx_bin.py
===================================================================
diff --git a/io_scene_fbx/export_fbx_bin.py b/io_scene_fbx/export_fbx_bin.py
index 22cd25c..8a1e1a2 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -1888,6 +1888,8 @@ def fbx_animations(scene_data):
# 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
@@ -1906,9 +1908,15 @@ def fbx_animations(scene_data):
add_anim(animations,
fbx_animations_do(scene_data, (ob, act), frame_start, frame_end, True, {ob_obj}, True))
# Ugly! :/
+ 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
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:
More information about the Bf-extensions-cvs
mailing list