diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2011-07-04 12:59:28 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2011-07-04 12:59:28 +0400 |
commit | cf43e48fc781611c0850e09dae6f6fa1c95cc28b (patch) | |
tree | d6a786c92891eae9482da7b80724b15ca2fa831c /source/blender/collada/ArmatureExporter.cpp | |
parent | aa1668c6f8a70e41b97b67f31647dbec382e19f7 (diff) |
Apply patch 4636051. COLLADA: Export selection.
Original patch by Jan Diederich, adapted by Pelle Johnsen. Review assistance by Daniel Tavares.
This patch adds an option to export only the selection.
Diffstat (limited to 'source/blender/collada/ArmatureExporter.cpp')
-rw-r--r-- | source/blender/collada/ArmatureExporter.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp index 90c3cfbb001..ad9098db3d8 100644 --- a/source/blender/collada/ArmatureExporter.cpp +++ b/source/blender/collada/ArmatureExporter.cpp @@ -89,14 +89,14 @@ void ArmatureExporter::add_instance_controller(Object *ob) ins.add(); } -void ArmatureExporter::export_controllers(Scene *sce) +void ArmatureExporter::export_controllers(Scene *sce, bool export_selected) { scene = sce; openLibrary(); GeometryFunctor gf; - gf.forEachMeshObjectInScene<ArmatureExporter>(sce, *this); + gf.forEachMeshObjectInScene<ArmatureExporter>(sce, *this, export_selected); closeLibrary(); } @@ -351,12 +351,17 @@ std::string ArmatureExporter::add_inv_bind_mats_source(Object *ob_arm, ListBase bPoseChannel *pchan = get_pose_channel(pose, def->name); + float pose_mat[4][4]; float mat[4][4]; float world[4][4]; float inv_bind_mat[4][4]; + // pose_mat is the same as pchan->pose_mat, but without the rotation + unit_m4(pose_mat); + translate_m4(pose_mat, pchan->pose_head[0], pchan->pose_head[1], pchan->pose_head[2]); + // make world-space matrix, pose_mat is armature-space - mul_m4_m4m4(world, pchan->pose_mat, ob_arm->obmat); + mul_m4_m4m4(world, pose_mat, ob_arm->obmat); invert_m4_m4(mat, world); converter.mat4_to_dae(inv_bind_mat, mat); |