Get position mesh during animation (imported .glb model)

Hi guys,

I’m trying to get the center point of a mesh during an animation, but so far I’m only able to get the static-mesh position (the position the animation was started in). For this project, I’m using Blender and the gltf exporter to export it to a .glb file. The animations are also created in blender and started with the Three.js AnimationMixer.

When I log the mesh of the object, the position stored in object.geometry.attributes.position does not change but returns the original position of the mesh.

var handL = this.model.getObjectByName( 'handL' ) // handL is of type SkinnedMesh
var boundingBox = handL.geometry.boundingBox;

var position = new THREE.Vector3();
position.subVectors( boundingBox.max, boundingBox.min );
position.multiplyScalar( 0.5 );
position.add( boundingBox.min );

position.applyMatrix4( handL.matrixWorld );
console.log(position) (the other proposed answer returned a position of (0,0,0) in my case)

Currently using Three.js version 104

Is there something that I’m missing?


Skeletal Animations are handled on the GPU so this data is not exactly accessible in js code at runtime.

Perhaps someone knows some workaround, but as far as I am aware there is none.