export bone transform matrix with sid.
authorSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>
Mon, 8 Aug 2011 16:38:57 +0000 (16:38 +0000)
committerSukhitha Prabhath Jayathilake <pr.jayathilake@gmail.com>
Mon, 8 Aug 2011 16:38:57 +0000 (16:38 +0000)
source/blender/collada/AnimationExporter.cpp
source/blender/collada/TransformWriter.cpp

index fc13207dd2e0ba1f5bf2858b1b0752a5bea1018e..4beab6f7608e0283ae2b2b48707ef834b011ce80 100644 (file)
@@ -586,7 +586,7 @@ void AnimationExporter::exportAnimations(Scene *sce)
 
                addSampler(sampler);
 
-               std::string target = translate_id(ob_name + "_" + bone_name) + "/transform";
+               std::string target = translate_id(bone_name) + "/transform";
                addChannel(COLLADABU::URI(empty, sampler_id), target);
 
                closeAnimation();
index 546ca3e30192fab64652cd3290d7d991e8a54ab5..3ac0654c86668e72a71ed8f5d47fcaab3e4abf18 100644 (file)
@@ -48,8 +48,13 @@ void TransformWriter::add_node_transform(COLLADASW::Node& node, float mat[][4],
                copy_m4_m4(local, mat);
        }
 
+       double dmat[4][4];
+       for ( int i = 0 ; i< 4 ; i ++ )
+               for ( int j =0 ; j < 4 ; j++)
+                       dmat[i][j]  = (double)local[i][j];
+
        TransformBase::decompose(local, loc, rot, NULL, scale);
-       
+       node.addMatrix("transform",dmat);
        add_transform(node, loc, rot, scale);
 }