Jump to content

More Animation / Skeleton Questions


reddozen
 Share

Recommended Posts

Is it possible to do something like... dude.attachToSkeleton(skeleton);

 

If not, could I attach a Bi-Pedal skeleton to an invisible box, and then attach the skeleton to my character model as needed and just ignore my invisible box? I ask because I have a skeleton with like 300 animations and 16 meshes (parts) I would rather keep one skeleton mesh and then just clone / instance it for each character model on the screen instead of having 20 times the duplication.

 

Even assuming that I need to attach every bone independently to the mesh parts of my character How exactly would that look? I could even merge all the sub-meshes first, then just run through every bone in the skeleton to simplify things? Would either one be "faster" than the other processing wise? I would assume that merging them first would be the best way.

 

 

So would something like this work properly?

player_mesh.attachToBone(skeleton.bones[0], generic_character_mesh); //head boneplayer_mesh.attachToBone(skeleton.bones[1], generic_character_mesh); //body boneplayer_mesh.attachToBone(skeleton.bones[2], generic_character_mesh); //arm boneplayer_mesh.attachToBone(skeleton.bones[3], generic_character_mesh); //leg bone.........
Link to comment
Share on other sites

I have a head, body, arms, and legs all separate meshes with no skeletons attached. I need / want to have a default skeleton that I can attach to different combinations of body parts to make a complete player character.

 

 

Can a skeleton be by itself without a parent mesh? If so, how would you import this?

 

 

If a skeleton has to belong to a mesh, and I can just attach it to a simple cube, then I can do the following?

// cube.default_skeleton is my skeleton to copyimport(cube);new_player = merge(head, body, arms, legs);new_player.skeleton = cube.default_skeleton;
Link to comment
Share on other sites

Interesting topic, so does this mean the skeleton bone envelopes/ranges are stored with the bones, then when the skeleton is applied to any mesh the specific weights for each vertex of the mesh are derived by babylon?

 

They are. If you look at the babylon scripts for a mesh with bones, you'll see weights etc in the XML. These are also tied to a mesh though. This is why I say just have a box attached. when you assign the new skeleton to a non skeletal mesh, then (as long as everything is lined up perfectly) it should in theory deform everything correctly as their positions should be relative.

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...