• Bugs
  • Attachments missing from exported .json

Related Discussions
...

Hello!

This thing happens very often in our project. Some attachments are missing from the slots in the exported .json, but in spine they are there and they are animated! It is really frustrating because we have to add them by typing them manually. :bang:

Any ideas why it happens and how can it be solved?

Make sure "use indexes" is UNCHECKED when you export the texture atlas.
Otherwise, avoid using underscores _, followed by a number, when naming your files (for now).
It means something special in the libGDX atlas format, but right now, it does nothing in Spine except cause confusion.

Spine should really have a warning for this.

I never checked "use indexes". I tried with it and without but nothing works. Still not exporting the attachment names with the slots. 🙁 I also renamed the things having the _# combination.

What attachments don't appear in the JSON? I see fish_1, fish_2, etc.

In the slot section there was no attachment there like for the eyes. I figured that it is because of the attachment not being visible in setup mode. The attachments should appear and animate, but not having the attachment in the slot section causes problems while implementing. Anyways I get it now. Sorry for wasting your time. My bad.

Ah, yeah the attachment specified for each slot defines what attachment the slot is given by default and when setSlotsToSetupPose() is called. If the setup pose doesn't have an attachment for the slot, it won't appear in the slot JSON.

I still don't get it. What just happened?
(Maybe it'll help other people who have the same problem.)

So OP's problem was solely on the basis of reading the JSON, and not what was visible at runtime or accessible through runtime code?

"no attachment" just meant no attachment in the Setup Pose?

Yep, I guess the OP is parsing the JSON themselves.

Yep.

Yep. So what appears in the slot section of the .json is the same as in setup mode which is understandable.
We are merging the .json files, having the rig and the animation as different .json files. Some animations have attachments, but sadly the programmers can not make the animated attachments to work. As soon as I put an attachment keyframe no image will appear in that slot when implemented.
Now I made 20 slots under these bones and instead of switching the images I animate alpha channel for each slot. Not very efficient, but we see no other way to put .png sequences to work in our weird case..