reddozen Posted September 23, 2015 Share Posted September 23, 2015 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......... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 23, 2015 Share Posted September 23, 2015 Hello Reddozen, perhaps I do not get your point but dude.skeleton = skeleton is not enough? Quote Link to comment Share on other sites More sharing options...
reddozen Posted September 23, 2015 Author Share Posted September 23, 2015 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; Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 23, 2015 Share Posted September 23, 2015 yep this should work:) Quote Link to comment Share on other sites More sharing options...
reddozen Posted September 23, 2015 Author Share Posted September 23, 2015 Perfect! Hopefully I can test this really soon. Quote Link to comment Share on other sites More sharing options...
Xeonzinc Posted September 24, 2015 Share Posted September 24, 2015 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? Quote Link to comment Share on other sites More sharing options...
reddozen Posted September 24, 2015 Author Share Posted September 24, 2015 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.