I am switching from learning x3d, three.js, and webgl to playcanvas so please be patient!
I have 2 different types of animations in 2 different .glb’s.
1 is skeletal mocap made in blender
the other is a “stashed” animation (a simple rotation loop) also made in blender.
I have seen other help topics quite similar to this one but the responses are not comprehensive and since I don’t really understand the workflow of Playcanvas yet, I’d appreciate a walkthrough!
I understand that glb’s need some scripting to separate out the animations and you can’t just slap an Anim component on it and hope it works. But where do I code this? And how? I am very new and very bad at understanding JS…
So for future referencers – anddd my edification – where did you put that script?
I see the animations working bbbuuuttt if you hadn’t done that and just sent the script I would have had NO IDEA where to put it hahahaa.
Thanks so much @yaustar … you are a real rockstar!
In the project, there is a script named load-glb.js. You add the scriptType instance to an entity that you want the GLB to be added under. I also just realised I made a mistake in the code so correcting that now.
You will also need glb-utils.js in the project somewhere which declares functions to load GLBs binary assets in the global scope.
I also use the uranus editor plugin to execute scripts in the editor, with just a minor addition (as explained in the docs) you can execute the load-glb script and let you interact with the GLB mesh just like with an FBX:
True, you can’t access materials in the editor when using the load-glb with uranus script, means its actually pretty limited and its best to work with FBX when there is more customization needed.
@yaustar is there more GLB editor customization on the roadmap? I mostly work with GLB and it seems to get more and more common in the future.
Yes, we really want to support GLB importing for Editor and trying to work out how best to go about it as there is a lot of customisability in GLBs that doesn’t quite work with our current Editor asset system