This is very confusing because the first time I tried this, it worked perfectly, but then a week went by and I neglected to save the exact version of my code, and now I cannot seem to reproduce it.
My goal is to have user’s avatars play animations that are being borrowed from a central “animation source” model. These are all glb models, all with the same skeleton because they are all ReadyPlayerMe avatars.
My technique is to look for the desired animation name on my local model’s mixer, and if it does not find it there, to call the global animation source model’s mixer, telling it to create a clipAction with the desired animation, pointing toward the user avatar’s object3D:
let action = theMixer.mixer.clipAction(params.name, this.el.object3D);
Later I set timeScale etc. and call play(), and this works fine if I use the object3D from the object that owns the mixer, but it says in the docs (and I was sure I tested successfully…) that the mixer is capable of creating an action pointed at a different object root. However, all I get is a TPose when I try to play the animations on my user avatar model. I can query the action for its time, and it appears to be playing the expected duration of the anim, I can ask it for getRoot() and it gives me a good link to what appears to be the right Object3D… but no anim is playing.
Can anyone come up with any typical gotchas, or things I could be doing wrong here?
EDIT: on further research, I believe that A) I was incorrect in thinking I had this working once already. But also B) I may have a clue. I have succeeded in getting my target avatar to show signs of knowing about the source animation, even though it does not exactly play it. Instead, it seems like the position/rotation values from the hip node are being played on the base of the avatar, i.e. it stays in its rest pose but the feet jump up to the hip position, and the whole body rotates in a way that looks like it is probably the anim’s hip rotations.
The really interesting part, however, was when I printed out the actual values of the animation tracks. I expected to see something along the lines of “Hips.position” and “Hips.quaternion” for the first channels, but instead I am seeing a UUID instead of the node name “Hips”. Furthermore, I see that when I use other models as sources, I get a different UUID here. This would neatly explain why I cannot use the animation, since my whole plan relies on the fact that all my node names are the same.
These models were produced in Blender using the GLTF exporter from Khronos Group. I guess I should go there to ask, but does anyone here have any idea about this renaming nodes to UUIDs issue?