Jump to content

Attaching skeletons to clones


Recommended Posts

This is my first time posting because usually I find everything in the documentation (really excellent, by the way). I have a scene with four worms in it and they are all individual meshes with skeletons. I manually removed three of them from the babylon file to reduce the file size and I recreate them as clones later but it seems like I am having difficulty attaching the skeletons to them. Can someone direct me to the documentation on how to attach a skeleton to a mesh? What is currently happening is that all of the worms are locked in the same skeletal position (not being animated) and doing something like 

worms[3].skeleton = scene.getSkeletonById(2);

does nothing. I should note, worm1 is using skeleton id#0, so that is not the cause.  I also found a Mesh.applySkeleton() method that I tried and that also did nothing. Am I missing a step? Nothing is frozen at all, either.

Screen Shot 2017-04-04 at 7.09.39 PM.png

Link to comment
Share on other sites

In that playground (broken on my iPad, by the way) it is showing cloning the same mesh and skeleton, and that method is essentially what I did but in my situation I have three skeletons in the scene that were never used and I am simply trying to attach them again  but they don't seem to be adjusting to the new skeleton positions, but when inspecting the mesh object the skeletons that I want are there. Is there something that happens in the cloning of a skeleton that takes place, or is there something that does not happen to a skeleton during loading if there is not mesh attached to it?

Thanks for all your help!


Link to comment
Share on other sites

That example had something new for me to try, but unfortunately still did not work. My goal was to reduce the downloaded file size and, as it turns out, my designer was able to reduce the size by about 50% by decimating the worms and the tunnels they are set in. So for now, with my deadlines, that is going to have to do. Eventually, I would like to solve this mystery, though, because in theory it seems like it should have been as easy as Mesh.skeleton = Scene.getSkeletonById(skeletonId) but that did not work.

Again, thanks for your guys' help!


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.

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.


  • Recently Browsing   0 members

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