I am working on a project where I want to import a ReadyPlayerMe avatar and then animate it. So far I have the import portion working and I am able to add the avatar to the scene. I am doing this all via JavaScript.
I am stuck on the animation part though. I’ve imported a Mixamo animation and if I manually add a character to the scene it is animated. What I want to do is apply the animation to my ReadyPlayerMe avatar after it is imported.
Initially I thought renaming the bones to match the Mixamo hierarchy would work, but that does not seem to work. I’ve done some Googling, but this is my first time working with PlayCanvas so I don’t know if the answer isn’t out there or if I don’t know enough to know what to be searching for.
How do I apply the Mixamo animation to the imported avatar via JavaScript? The bone hierarchy is the same (except for the names) so I think the animation should be able to transfer pretty smoothly in theory.
@modelsbymike3d , I see some of the problem. The code is creating a render component hierarchy and that is not compatible with the animation component.
Yes, I have integrated them in one of my projects, I was using the simple Anim component and just swapping the default model out and replacing it with the dynamically loaded model, just be careful about the caching issue, because the link will be the same(from readyplayerme) so the browser will return the cached model even if the user changes a cosmetic on the model, so to overcome it, add something in the link arguments like “id=2312321” some random number so the cached model is not returned.
That might work better for my use case. So to make sure I understand, I add a placeholder avatar with the animation to my project, then at runtime I can read whichever one I want and swap out just the model?
I am still not able to get it to work. I wasn’t sure how to swap out the mesh and materials, so I tried going the route of copying the animation from the placeholder to the imported model. I created a super simple animation for the placeholder so all the bones should match between the two.
I tried both the anim and animation components, but I’m having a hard time figuring out what exactly I need to do. Same project, just edited the script.
Thank you so much for that info! I didn’t realize the bone structure was different; I misunderstood their documentation.
And thanks for sharing your fork! I got the animation applied to my own character now. The x rotation is off by 90 degrees, but that was easy enough to fix by rotating the parent entity.
I’m super excited to keep building with PlayCanvas!
Why not upload the default Readyplayerme on Mixamo, let Mixamo configure the animation to the bone structure of the avatar of Readyplayerme? AFAIK I did that for my integration to make the animations compatible.
My idea is to create some sort of scene with an animation and let each user import their own ReadyPlayerMe avatar. I figure it would be easiest to not mess with the avatar bone structure at all.
I do the same thing: (The user can choose any kind of avatar, and the animations from Mixamo work fine on all of them.
as I said, you can follow these steps to achieve it:
Upload default avatar to Mixamo.
Mixamo will output animation which is compatible with the bone structure of the avatar and since all readyplayerme have same bone structure, the animations will work perfectly fine for all avatars.
After loading the avatar as GLB from their link, just beware of the cache (since link is always same), so to bust it use some argument in the link.
Replace the loaded glb (model) with the model in your project and the animation would run perfectly.
I dont have a sample project for the above steps but will I make an example of readyplayerme integration with Playcanvas sometime soon, atm I have alot going on, maybe some time in the next month.
Yes I follow the video, check the include texture mark. On Windows 3D Viewer the fbx contains a kind of texture but it look like a patchwork. I assume Mixamo ignore them.
I’m on fresh blender install
I try with a random ReadyPlayer Me avatar
I probably missed something.
So as a workaround In Blender I copy Material + UVMapping from ReadyPlayer Me avatar to Mixamo Fbx, it works but a little more slower