• Editor
  • Swapping skins in the C++ runtime

Edit: Fixed. Solution was to call skeleton->setToBindPose after swapping skins.


I know the C++ runtime is still in development, so it's possible that this isn't fully fleshed out yet.

Swapping skins at runtime isn't working for me. If I load up the goblins skeleton, and set the skin to either "goblin" or "goblingirl" then play the animation, it works. However, once I pick one I'm stuck. I tracked it down the the Skin::attachAll method. It doesn't get inside the if statement comparing attachments.

What are we testing there? Surely the attachment addresses shouldn't be equal. I tried changing it to check attachment->name, but that doesn't seem to be set anywhere. I'm pretty sure that's an easy fix, but I wanted to make sure that's the right direction before I do it.

FWIW, if I change it to if(true) the swap goes perfectly, so everything after that works great. :sun:

Related Discussions
...

I think you might have to re-bind your skeleton if you set a new skin? There was something about this in one of the other forum posts, IIRC. Try setToBindPose() after you set the skin.

Yep. That's totally it.

Well, that's a bit embarrassing. Search turned it up in about a second. 😛