[Bf-extensions-cvs] [fa90003] master: FBX export: also export armature matrix in binding data of clusters

Bastien Montagne noreply at git.blender.org
Sat May 3 16:05:57 CEST 2014


Commit: fa90003bc753bbe7f98b227b4573b3b1640ce7a3
Author: Bastien Montagne
Date:   Sat May 3 15:57:11 2014 +0200
https://developer.blender.org/rBAfa90003bc753bbe7f98b227b4573b3b1640ce7a3

FBX export: also export armature matrix in binding data of clusters

Looks like nothing is expected for BindPose nodes here? Anyway, I'd guess those are
doublons with cluster data... :/

===================================================================

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 393005d..bdd18ea 100644
--- a/io_scene_fbx/export_fbx_bin.py
+++ b/io_scene_fbx/export_fbx_bin.py
@@ -1802,6 +1802,7 @@ def fbx_data_armature_elements(root, armature, scene_data):
         * BindPose.
     Note armature itself has no data, it is a mere "Null" Model...
     """
+    mat_world_arm = fbx_object_matrix(scene_data, armature, global_space=True)
 
     # Bones "data".
     for bo in armature.data.bones:
@@ -1888,8 +1889,8 @@ def fbx_data_armature_elements(root, armature, scene_data):
                 if indices:
                     elem_data_single_int32_array(fbx_clstr, b"Indexes", indices)
                     elem_data_single_float64_array(fbx_clstr, b"Weights", weights)
-                # Transform and TransformLink matrices...
-                # They seem to be mostly the same as BindPose ones???
+                # Transform, TransformLink and TransformAssociateModel matrices...
+                # They seem to be doublons of BindPose ones??? Have armature (associatemodel) in addition, though.
                 # WARNING! Even though official FBX API presents Transform in global space,
                 #          **it is stored in bone space in FBX data!** See:
                 #          http://area.autodesk.com/forum/autodesk-fbx/fbx-sdk/why-the-values-return-
@@ -1897,6 +1898,7 @@ def fbx_data_armature_elements(root, armature, scene_data):
                 elem_data_single_float64_array(fbx_clstr, b"Transform",
                                                matrix_to_array(mat_world_bones[bo].inverted() * mat_world_obj))
                 elem_data_single_float64_array(fbx_clstr, b"TransformLink", matrix_to_array(mat_world_bones[bo]))
+                elem_data_single_float64_array(fbx_clstr, b"TransformAssociateModel", matrix_to_array(mat_world_arm))
 
 
 def fbx_data_object_elements(root, obj, scene_data):



More information about the Bf-extensions-cvs mailing list