Merry Crhitmas! Export an .obj with wrong pose from the current scene

Hello Everyone. Merry Crhitmas.
Now I have an urgent problem now, so I am looking forward your help.
I am developing a three.js project. My major skill is web site develope and python automation.
So, I am not familiar with three.js.
You can check my project here.
And, if you want, I can provide the source code.

As to my project:
It imports a mouse(rat) 3D mesh from a gltf file.
Then, if I change the inputs values, it update the bones and joints values of the Mouse mesh.

But, when I export the Mouse 3D mesh as an object, it has some problems now.
For example, the current 3D mesh on the scene is changed a little per exporting.
And, if I import another pose from csv files after exporting, it generage a broken pose.

This is my current exporting function.

document.getElementById(“export-btn”).addEventListener(“click”, function () {
scene.traverse(function (object) {
if (!object.isSkinnedMesh) return;
if (object.geometry.isBufferGeometry !== true) throw new error(‘only buffergeometry supported.’);
object.skeleton.bones.forEach(bone => {

      let filtered = initialRotations.filter(rot => {
        return ==
      if (filtered.length > 0) {
        bone.rotation.x = filtered[0].x;
        bone.rotation.y = filtered[0].y;
        bone.rotation.z = filtered[0].z;
        // bone.rotation.set(0,0,0)
      else {

        bone.rotation.set(0, 0, 0)

    var positionattribute = object.geometry.getAttribute('position');
    var normalattribute = object.geometry.getAttribute('normal');
    var v1 = new Vector3();
    for (var j = 0; j < positionattribute.count; j++) {
      object.boneTransform(j, v1);
      // object.getVertexPosition(j, v1);
      positionattribute.setXYZ(j, v1.x, v1.y, v1.z);, j, v1);
      normalattribute.setXYZ(j, v1.x, v1.y, v1.z);
    positionattribute.needsUpdate = true;
    normalattribute.needsUpdate = true;

  // Apply bone transformations to the skinned mesh before exporting

  // Create a new OBJExporter
  var exporter = new OBJExporter();

  // Export the updated scene
  const result = exporter.parse(scene);
  const blob = new Blob([result], { type: "text/plain" });
  const link = document.createElement("a");
  link.href = URL.createObjectURL(blob); = "exported_model.obj";;


document.getElementById("import-btn").addEventListener("click", function () {

document.getElementById("csvInput").addEventListener("change", function () {


Sincerely hope your help.

Skeleton animations and posing (ie. bone transformations) are applied on the GPU - they are never visible / available on the Javascript side of code.
But moreover and besides - OBJ format does not support armatures, so your best bet would be to manually apply bone transformations to the position buffer on the CPU.

Thanks for your reply.
But I am beginner in this field.
So, I’d be really happy if you provide some example code for this.