Is there an easy way to reuse skeleton on a cloned mesh?

Hi everyone!

I have a question of cloning and skeletons. I have this playground I made earlier:
https://playground.babylonjs.com/#S7E00P#49

Now, in the playground I clone meshes and their skeletons and animations. But I keep thinking if there is a way to reuse the original skeleton and not recreate/clone the skeleton? I think with many characters and cloned skeletons, I get some performance problems… So I keep wondering if I could reduce the framerate hit with a single skeleton :slight_smile:

Another thing is also the fact that if I start an animation, it seems that it is executed even though the mesh itself is not visible at all…

Unfortunately I do not think there are any other ways, maybe @Deltakosh would have some other tricks ?

1 Like

I guess the real question is how to get better performance when there are a lot of meshes with animations and skeletons on the screen at once? Here is pretty much the worst case scenario:

https://playground.babylonjs.com/#S7E00P#116

All the characters can have different animations and clothing that they wear… But I guess I have some options that I listed below, what do you think about these and do you have any other ideas?

  1. Make the skeleton more simple, no each finger for example
  2. Maybe combine the character meshes? For example, in the current character mesh there is separate body, hair and clothing meshes
  3. Find a way to reduce the amount of skeletons?

Also I would like to point out the fact that it seems that when the animation for a mesh is playing, it cannot be view culled? Is this a known fact?

Here I’ve stopped all the animations and the culling works if you rotate the camera, unlike in the other example:
https://playground.babylonjs.com/#S7E00P#117

Maybe @Evgeni_Popov or @bghgary have some tricks here ?

1 Like

A way to have fast skeleton animations for multiple objects is to use vertex animations baking. See this thread (be sure to read until the end of the thread):

You can try to use refreshBoundingInfo(true, true) on all your animated meshes to take the bones/morph into account to compute the bounding box. If it’s still not enough, you have the option to set alwaysSelectAsActiveMesh = true on all the meshes.

5 Likes

Hello,

Thanks for update and quick reply, looking for similar question and found lots of helpful information here, Really appreciate for help.

1 Like