Mesh changes position when trying to compute morph changes

I am trying to build a character creator using a skinned mesh with various blend shapes made in blender.

The morph targets are working correctly but when i try to update the vertex positions using computeMorphedAttributes, the mesh changes rotation and the verticies end up in the wrong place.

I tried removing the skeleton from the mesh and it stopped rotating it, but it looks like the vertices are being scaled up now.

Before updating vertex positions (what it should look like):

After updating vertex positions (normals are fixed but vertex positions are wrong):

The mesh positions are being updated when the button in the UI is pressed:

botao: function () {
        if (mesh) {
            mesh.geometry.setAttribute('position', BufferGeometryUtils.computeMorphedAttributes(mesh).morphedPositionAttribute);
            mesh.geometry.computeVertexNormals();
        }
    },

Writing the computed morphed attributes back into the mesh will make the morphing be applied twice.

Why do you write the morphed attributes back to the mesh? I think they are intended to be used separately for effects that don’t know about morph targets…

When i apply the morphs the normals dont get updated i think. So the shading looks wrong.

I saw other posts saying that i needed to write it back for the normals to look right thats why i did that.

Perhaps you can write the morphed data back to a different geometry that does have the morph targets, or somehow disable them after you write back?