I just want to see the correct way to animate something in Blender such that it can be exported to a .babylon file and actually work once imported into a babylon scene.
I can make the “Dude” test animation walk in my scene, but various rigged humanoids that I’ve downloaded from TurboSquid do absolutely nothing. So I just want to see what I’m missing in Blender when it comes to animation. I’m sure mostly the issue is that I don’t understand Blender, but a perfect example that I can play with might be a good place to start.
I’m not comfortable about animations, but I think you probably have to bake some keys before exporting in some usecases (example: IK setups).
Since I don’t know too much about that, I would recommed to try with a very simple mesh and a very simple skeleton to see what can be exported and what can’t be.
Any idea where I might find this super-simple animated blender file that exports successfully to .babylon? Because I have not had any luck in finding one. I have no idea what baking keys is, but if I get some help here, I’ll bake you cupcakes…
Thanks @JCPalmer! That is exactly what I was looking for. The in-page code is useful too, because I initially exported to .babylon, and used the same code as the “Dude” example, and it didn’t run. So I grabbed the example page, and it runs the exported .babylon file perfectly, of course. So maybe that’s where I was going wrong with some of my other attempts. Creepiest humanoid animation ever, btw ahahaha. Oh and here is a cupcake…
Wow, I’ve never heard of Mixamo before. Have you had much experience with their workflow? I’d love it if there was a tool that just handled all the 3d character stuff, so that I can get back to programming the fun stuff.
Has anyone got this working? I have attached a blender 2.8 scene file with some simple bone/armature animation on a cube + .glb file + some code I am using. I see the animation working nicely in the babylon sandbox (https://sandbox.babylonjs.com/) but cannot figure out what code I should be using … everything I am doing is attached in the zip file, if anyone could help I would be eternally grateful.
There is nothing in that file that contains scene.beginAnimation or anything similar I can see. Are you sure that there is code in there that I can use to play animation?
Or just use this code below to import your glb or gltf file and then play a skeleton/bone/armature animation.
// import glb
var exampleGLB = BABYLON.SceneLoader.Append(
“filePathToYourGLTF”,
“fileName.glb”,
scene,
function(scene) {
// Play animation
scene.animationGroups[0].play(true);
}
);
I love babylon sometimes … this is so simple and freaking awesome!