Wedrownik

Hello,

Is it possible to import skeleton with bones and frames into another skeleton?
I am thinking about a system where I have skeleton with a spell and characters with different weapons. I would like to share spell animation between characters using their weapons. It would let me keep character textues with their weapons on their own atlases instead to pack all weapons into the skill's atlas and load them all when only one character will use spell.

Does anyone have idea how I could do this? :think:

Have a great day ! :)
アバター
Wedrownik
  • 記事: 141

Erika

Hi Wedrownik, you actually can, with some recommendations.

You can first export a json from the project you want to bring into the other. Then import it using import data, and choosing the same skeleton:
Import - Spine User Guide: Data


Next you can import the spine file and choose the animations you want to import. (you can use ctrl or shift to select them all at once)
Import - Spine User Guide: Animation

BUT you need to be careful: the bones of both projects need to have unique names that don't overlap across the two skeletons. The same goes for images, slots, etc. or the import may go wrong. The same goes for the animations.


But let's rediscuss this idea first: perhaps you don't need to import the spells for each character, you could simply import them as two separate skeletons in the same project to ease the animation syncing of the effects, but just match their roots at runtime overlapping the vfx on the characters. Otherwise you may be needlessly repeating identical data across all the projects.
アバター
Erika

Erikari
  • 記事: 2412

Wedrownik

Hi Erika !

Thank you for reply. I am working on the 3.7.94 version and thus didn't see this option. Hope we will upgrade project to the newer version asap.

In turn referring to your proposal. You are right about repeating data and in that case I was thinking about this idea to keep weapon textures with the characters (weapon per character in the character's atlas png). My idea was to have one skeleton with a character and character's weapons (one atlas here) and second skeleton with all weapon/skill effects which I keep in the one place.

I am thinking also about skins in the skeleton, with the sub-skeletons, where each skin would be weapon like Skin 1 - dagger, Skin 2 - sword etc. Thank of that I could keep in the one skeleton, several weapons, animation for them and textures could be packed per folder.

Another idea and the most simple, is to make skeleton per weapon.
アバター
Wedrownik
  • 記事: 141

Erika

If you can upgrade to Spine 3.8, definitely do so, especially since we've released skin bones and constraints, which would be just about perfect for your use case: Blog: Spine 3.8 released: Skin bones and constraints

They allow you to have everything in the same skeleton, with only the necessary bones and constraints for the selected skins being calculated at runtime.
This would also make managing your project to edit it and re-export it later much more easier.
アバター
Erika

Erikari
  • 記事: 2412

RemDust

Hi Erika !
I've managed to make it work for bones but I was not able to export/import constraints :'(

Am I doing something wrong, is there any way to do it ?

:think:
RemDust
  • 記事: 195

Erika

Hello! As I answered on the other post you opened, the feature is planned but not available yet: Duplicate constraints · #183 · EsotericSoftware/spine-editor
アバター
Erika

Erikari
  • 記事: 2412


Return to Editor