Jump to content

Cloning advanced meshes & their skeletons outside loader


aWeirdo
 Share

Recommended Posts

Hi all, i've been having some issues with cloning skeletons outside the importer.

I'm not sure why it goes wrong..

the mesh itself is cloned fine, the actual skeleton aswell, but the animation don't play.

From console logs, it seems the cloned skeleton is missing "_transformMatrices" compared to the original one, and "_isDirty" is true.

http://www.babylonjs-playground.com/#1EL5BE#6

any help is greatly appreciated.

 

Edit: (See the first topic comment below for info).

PG: http://www.babylonjs-playground.com/#1EL5BE#21

Link to comment
Share on other sites

Update:

After taking a break from it, 

i came back with a clear head and started debugging it,

I figured out what was going on and created a function which supports complete cloning in multiple cases of complex models & their skeleton(s).

The mentioned issue was a missing link, due to the way i handle the skeletons, in the dude's case, the cloned children's .skeleton variable was undefined.

The function supports the following cases;

Single mesh & single skeleton. 

Invisible parent with multiple children & single skeleton. //Same skeleton for all children.

invisible parent with multiple children & multiple skeletons //One seperate skeleton for each child.

 

Feel free to use it as you wish, 

PG: http://www.babylonjs-playground.com/#1EL5BE#21

Link to comment
Share on other sites

  • 2 years later...

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