Thanks, I think that make sense.
Are there any good playgrounds where an animation is added directly to a bone - on a loaded GLTF?
Thanks, I think that make sense.
What kind of animations do you want to add? Maybe you can create a simple playground that we will use to see how we can help you?
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.
Ok this is an interesting use case.
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
Ok. Gave that a try:
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.
Are you sure about myMesh? not sure if myMesh should be set to newMeshes
You should look for the one having a skeleton already
Something like that:
Now you also need to clone the animationGroup that was targeting the previous skeleton
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
Have made scale identical.
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.
I copied skeletons over for each of the body parts.
Is it working?? I think it might be! But hard to tell. Testing more…
Nope, darnit. They’re still separate animations on separate models.
Removed the body from one to make it more clear what’s going on.
Here, if everything was working, we would have copied over the animation data from the body-less character onto the character that is currently doing the “Jab” - and both animations would then be attached to a single character (as if they were combined in the original source file).
What is weird is that we definitely see that hairs are animated and it does not seem random
Also can you try to make a far simpler scene? like just a node with a dead simple animation? I’m sure we will find a way to make it work as you want
Sorry, the hair was confusing things… (i did that on purpose). Less confusion here, where you can see the models acting separately: https://www.babylonjs-playground.com/#D9U0UW#18
I can/will make a simpler scene. However, I’m not sure the problem will be solved with a simpler scene (since it may not work for Mixamo-exported files).
The big opportunity here, in my opinion, is to be able to build a very light library of animation data files that can be loaded easily into a scene - and applied to a humanoid skeleton using the mixamo rig. It would make animating a character 1000x more accessible to people using BJS.
So, where you could load up a model that you’ve designed using Mixamo or Fuse. And then do something like:
And it loads in the keyframe data and appends it to your model.
But here there is something I do not understand yet:
What we see is just the regular loaded meshes with no skeleton shared
Yep we are not targeting the right meshes ;D
lol…look at the console
Right. That was just a fix of the scale issue you mentioned earlier… but the PG still has 2 models with one animation each, instead of 1 model with 2 animations.
Hey, is it possible/easy to use the Json data instead? That would really clarify things… if we could just load the animation from JSON and then add it to the single loaded model?
(note that this json file has the scale issue, so i’d need to fix that if this route is viable)
It works here:
We have two meshes animated with the same skeleton. So if you hide the second loaded models you have the first model animated with loaded data !!