Hi there.
Today i bit the bullet and learned how to rig. Rigged up a very simple skeleton and thought i did a decent job in Blender. But when imported into Babylon as GLB, got unexpected results.
Can’t move the mesh via the bones (as i can on the Dude model). Can only move the mesh via transform nodes. Assume that this is not the right way?
There is an extra bone at the feet
Any tips on how to best rig for Babylon? Am I missing some technique?
Can’t move the mesh via the bones (as i can on the Dude model). Can only move the mesh via transform nodes. Assume that this is not the right way?
The way glTF skeletons work in Babylon.js is a bit different. glTF uses nodes for bones. To mimic this behavior in Babylon.js, the bones are linked to transform nodes in the scene. If you move the bone, it will immediately be overridden by the transform of the linked node. I know this is confusing, but we haven’t found a better way to do this yet.
There is an extra bone at the feet
I think you are talking about the debug skeleton viewer showing the connection from the root of the skeleton to the first level bones. In the glTF skeleton, there are two bones shin.L.001 and shin.R.001 which have no children.
Thanks! That all makes sense.
Does the IK setup come over to Babylon in either glTF or Babylon formats? Doesn’t seem like the control bones work (that’s what shin.L.001 and shin.R.001 are)
The yellow calf bone tells you they are IK bones and they are set to “not deform” the mesh. (Click on the bone tab in the properties panel - the “deform” box has no check. Now for .babylon export you have an option to NOT export them. With that IK bone selected click on the pink globe tab and look at the “animation” panel and check “ignore IK bones” box. there will be no export then. Now in versions earlier than Blender 2.8 the name of those Ik bones had to include “IK”, so I would name them ShinL.IK and ShinR.IK to ensure they are not exported.
If you are going to use Ik for the legs - I would add a KneeL.IK and KneeR.IK. But that is all for .babylon export - I don’t use the GLB stuff.
As far as I know @bigrig both are true. But to be honest, I have never tried to use the Babylon.BoneIKController. I just want to create my animations in Blender and then export them (without the IK bones).
It seems you are looking to do/create animations in Babylon itself. I try to work with a minimum number of bones and even use animations that I can get from .bvh files that I import into Blender.
Getting a little deeper into animating these skeletons. Again running into some walls. Will none of the copyAnimationRange+beginAnimation functions work since animating skeleton movements are being overidden by transform nodes? Is there a way to tell a function like copyAnimationRange to copy to the transform nodes instead?
Hey Bigrig! I agree this could be complicate. Unfortunately babylon.js has to accomodate with a lot of different ways to animate things (gltf, blender, 3dsmax, etc…)
None of the copyAnimationRange will work as there is NO animation range defined on your skeleton,
Skeletons can be animated (like any other entity in babylonjs actually):
directly by adding animations onto each bones
using AnimationGroups (which is the case of gltf)
Here because we are using gltf (which specs mimic what Unity does), we are animating nodes that will control bones so the skeleton animations are empty.
That would be so awesome. Have been banging my head for a few days on this. In sum, I want to be able to load a character with skeleton. And then load, separately, animation data and to be able to animate the character with that data.
So technically, you should be able to only change the skeleton property of your mesh. If the new scene loads correctly, you should get a new skeleton, then it should be enough to do something like myMesh.skeleton = newSkeleton
Don’t think it did anything. In playground above, if it worked, I’d assume that both characters would be doing the “Jab” animation.
Btw, if we can get this working, I will make and share a shiton of animation data files… so that anyone should be able to load any character with a mixamo rig - and use these animations with a minimum of fuss. Think it’ll really be useful/fun for BJS makers.
It is not working now because the armature object on first mesh is not the same as of the second mesh (one has a scale of 0.01). If you make them identical it should work flawlessly
But not sure what I’m looking at here. Seems like two separate models with separate animations? (and one party disembodied, poor guy). Rather than loading the animation from one model onto the other. Am I misunderstanding?
Oh, or is that all actually the same mesh, but 1/2 of the mesh (hair/shirt/shorts) is playing one animation and 1/2 of the mesh is playing the other animation (head/torso/legs) ?? Woa.