Jump to content

Multi-Mesh Animations


reddozen
 Share

Recommended Posts

I was looking over the documentation in tutorials section 4 about using bones and skeletons, and the example looks pretty inefficient for what I'm trying to do. Maybe I'm looking at this from the wrong approach?

 

We have  character model mode up of maybe 10~12 parts, and a single skeleton that controls all those parts. based on the example, you're assigning a whole clone of the skeleton to each sub mesh of the total character model. This would be very bad in the case of our animations that have 17000+ key frames (assuming we can even get the rigging simplified enough to use).

 

Do we need to load in all the sub-meshes and merge them into a single model, then attach the skeleton, or is there a way that we can attach all these sub-models to a single skeleton? I would rather be able to attach the sub-meshes to a single skeleton as it would be a simpler process for swapping equipment rather than reloading every piece of equipment, merging them again, then reattaching the skeleton. I would rather be able to just swap out the section that i need to replace as needed. The may be an issue with inheritance as the model inherits the skeleton instead of the other way around. If this is the case, would it be possible to also let skeletons inherit meshes as needed for complex models like this?

 

Just trying to understand my best solution to this problem.

 

 

Example from the tutorial:

for (j = 1; j < newMeshes.length; j++) {    c[j] = newMeshes[j].clone("c" + j);    c[j].position = new BABYLON.Vector3(xrand, 0, zrand);    c[j].skeleton = newMeshes[j].skeleton.clone();    scene.beginAnimation(c[j].skeleton, 0, 120, 1.0, true);}
Link to comment
Share on other sites

In other hand I do not wee why this would not work:

for (j = 1; j < newMeshes.length; j++) {    c[j] = newMeshes[j].clone("c" + j);    c[j].position = new BABYLON.Vector3(xrand, 0, zrand);    c[j].skeleton = newMeshes[j].skeleton;    scene.beginAnimation(newMeshes[j].skeleton, 0, 120, 1.0, true);}

I think (I did not try but looking at my code, this seems legit) that a skeleton can by applied to many meshes

Link to comment
Share on other sites

Wouldn't that cause extra copies of the skeleton? Instance or clone, if I assign the skeleton to my armor, then legs, then hands, then head (all sub-meshes) don't I then have 4 copies of the skeleton for the complete model? All my equipment pieces are separate models that I need to combine into a single animated character.

 

My scenario is this: ( there are actually probably 50 different pieces of each equipment type or more )

3 different armor

3 different legs

5 different arms

1 skeleton

Link to comment
Share on other sites

The deal here is that each model has the whole skeleton included in the file (for example, even if it's the gloves, the whole biped is in the file) for rigging purposes.

 

Everytime we add a piece of armor we would add the whole skeleton here, therefore, if we add Legs, armor, even an accessory that is rigged for some reason would add up the skeleton.

 

A fast solution by reading this could be removing the unused skeletons, however it is obvious that pieces are going to use the same bones, for example the legs on the bottom of the shirt.

 

What i've done before in 3ds max for example, when working with this kind of issues, is cheking if the bone was already in the scene, if it wasn't, i would just add it, else, i would use that bone to apply the rigging of the mesh.

 

However, didn't check the documentation, but i assume there are any functions of add vertex weights and rigging, so it would be kind of waste of time i guess.

 

Not sure if i explained myself properly, but that's the problem, it's fine in the instanced bones example since there are no split parts of the mesh used and it's a whole body for it.

 

The ideal thing would be selecting a skeleton, then add a mesh, look in the rig section of the file the rigged mesh and the bones and look for them in the skeleton, and apply the rig, or at least that's what i always did when i could, but i wonder if we can do it here.

Link to comment
Share on other sites

  • 3 months later...

Thanks DK, we'll test it out.

 

Did you manage to solve this? I'm trying to get my hands around this as well and I'm having no luck with it..

Would you mind sharing your solution if you managed to fix it? 

 

I also have a player model which I want to equip with meshes on the specific parts.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...