I currently have a Three.js project with an animated scene and I am trying to obtain the positions of skeleton bones at various points in time.
If I visit, for instance, and inspect the Three.js scene:
const modelViewer = document.querySelector("model-viewer");
const scene = modelViewer[Object.getOwnPropertySymbols(modelViewer)[14]];
I can then retrieve the position of the LowerArmR
bone which is being animated in this example:
scene.children[0].children[0].children[0].children[0].children[1].children[0].skeleton.bones.find(b => b.name == "LowerArmR").position
However, regardless of the animation progress, the retrieved position remains constant:
{x: 1.86264503820865e-10, y: 0.00575238140299916, z: -1.02445485428149e-9}
Is there a way to access real-time skeletal positions during animation?
Upon applying this method to a humanoid avatar undergoing animation, I only see the default T-pose rather than the actual bone positions as they change over time: https://i.sstatic.net/MILfq.png
According to this source:
Skeletal Animations are managed on the GPU, making it challenging to access this data directly through JavaScript code in real-time.
Although potential workarounds may exist, none are widely known or established.
Therefore, I am seeking information on any workaround or standard approach to accomplishing this task.