- Skeleton Merger Tool
Recently (and in the past), there has been quite a few threads of people wanting to merge two (or more) skeletons into one. Spine allows you to create multiple skeletons in one project. Unfortunately spine does not allow you to take bones from one skeleton and copy them across to another skeleton. Spine also restricts copying key frames, in that you can not paste key frames to another skeleton.
I bring to you, Skeleton Merger Tool!
What does it do?
The Skeleton Merger Tool (SMT) will take two Spine skeletons and merge them into one skeleton.
Can't I Do This My Self... Why should I use this tool?
Sure you can! Lots of cases it can just be copy/paste of one json into another. The problem comes with meshes however, rearranging vertices would be pretty time consuming and annoying. (see next question)
Why isn't this officially supported by the Spine editor?
My best guess is that this could potentially take A LONG time, remapping vertices is probably the most expensive operation. Each vertices in
SkinnedMeshs (mesh with weights) is tied to a
bone ID, and the
bone IDis related to the position of the bone in the bone list. As you are adding new bones to that list, all of those vertices
bone IDneed to change. And to make things worse those
bone IDs are deeply nested in data types. Also Spine would need to deal with name conflicts on animations, bones, skins and slots.
If Spine supported this, it would also have to support splitting up of skeletons, which (im pretty sure) could take much more time.
How does Skeleton Merger Tool deal with name conflicts
If you have name conflicts between the two(on Bones, Slots, Skins or Animations), SMT will resolve them by adding a number at the end of the name, it will increase the number until the name is unique.
I feel like this could be done in a better way, I am open to suggestions.
Can SMT Merge animations and skins?
Currently, no. The reason is, once both your skeletons are merged, you can copy keyframes to the original animation if you want. Or in the case for skins, apply two skins at runtime.
This being said, it is planned in a future update to add command flags to allow you to merge skins and animations.
Is there a preview window?
No, I felt like adding this would make the tool a little too much like the spine editor. If I get express permission from Esoteric Software I may add one. Although adding it will be low priority.
Can SMT Split skeletons into new skeletons?
No. Reason is, I feel like this would be a conflict of interest with my work. Can't go into detail, sorry. My work was kind enough to let me release this though .
(maybe in future though)
How do I use SMT?
- !!BACK UP!!
- Run the
- Enter the directory of the skeleton you want to merge
- Enter the directory of the skeleton you want to merge to.
(The output will be in the same directory)
- import merged skeleton
Any Future Plans / will this be supported?
I will be supporting it, however I have limited free time (sorry). If any major bugs pop up I will try to address them immediately.
Things I plan to do:
- Add support to merge skeletons from
- Add Merge Flags to merge animations/skins
- Better Bone Ordering
Things that I might do:
- Merge hierarchy of bones to a skeleton
- Load/Save skeletons/bones
- Add a GUI
Please feel free to request things and I will (probably) add them to the list.
Need something urgently? PM me and reply to this thread, maybe we can arrange something .
Will This be open source?
Hmmm, this one is unanswered. I would like to make it open source, but before that happens I need to finalise how the data is stored.
Not yet, soon.  I accidentally posted this, I meant to preview, rather than delete I will just update when I release the tool (should be a day or two....?). The current state of the tool is that it works, for bones, meshes, slots, attachments and skins. I'm currently working on getting animations to merge.
[i]The way I have read and stored the json file (skeleton to merge) means that the bones will be in a different order, their hierarchy should remain the same. This is not a problem for spine Versions 2.1.27 or 2.1.7. Any other version the merger may not work. I will update if this changes in V3.
I would also recommend that you always import to spine and do a fresh export before using the merged skeletons.