I would need to see your atlas to be sure, but I assume it contains region names like:
spineboy/crosshair
spineboy/head
raptor/head
In the Spine projects, the attachments are named eg crosshair
so that is the name it looks for in the atlas. It's not there because it's spineboy/crosshair
.
You can use combineSubdirectories
to pack folders together and flattenPaths
to remove the folder names. However, you need to take care if two folders contain an image with the same name, like head
. When using flattenPaths
usually you want all the image names to be unique.
Alternatively, you can modify the Spine projects so they use attachment names like spineboy/head
and raptor/head
. You'd set all the projects to point at the same images folder, which also makes it easy for projects to share the same images. Then the atlas you've made will work. You can use the Find and Replace dialog to make adding these prefixes in the Spine editor easier.
Alternatively, you can create your own AttachmentLoader at runtime that knows which skeleton it is loading. When loading the spineboy skeleton, it would look in the atlas with a spineboy/
prefix to the region name. When loading the raptor, it would use a raptor/
prefix. Then the atlas you've made will work.
How attachment images are found in the atlas is very simple. It's similar to how it's done in the editor, see here:
http://esotericsoftware.com/spine-images#Image-file-lookup
At runtime, see here:
http://esotericsoftware.com/spine-loading-skeleton-data
AtlasAttachmentLoader is used by default and it looks in the atlas for the attachment name (or path). You can customize that, as mentioned above, by using your own AttachmentLoader. Otherwise, you need to make sure the paths in the atlas (look at it with a text editor) are the same as you see in the Spine editor relative to the images folder.
If two images are 100% identical, they will only be packed in the atlas once if alias
is enabled. That is one way to avoid having two of the same head images. If they differ at all, even a single pixel, they will be packed separately.