I've seen a few answers about this but they were highly specific and I haven't seen any definitive answers for this.
We recently implemented Spine into the FlatRedBall game engine, which primarily focused on frame-based animation before. It's a common practice in our engine (and many others I think) for the artist to hand edit a spritesheet (aka Atlas) since they are usually working on tilemap tiles, characters, weapons, and other art in one place. We have an Animation Editor that allows you to map animation frames on a spritesheet, and a Texture Mapper that maps textures on a spritesheet. Many games released on our engine have a single 4k texture with all game art on the texture (across multiple tools like Tiled, the engine itself, and UI tools).
It was important to us to support existing workflows while also adding Spine. But I can't find an easy way for Spine to support existing atlases. Here's the process I found:
- We built the ability for our animation editor to save out a Spine atlas format, so the game might produce
spritesheet.atlas
, allowing the artist to map textures during their normal process.
- Unpack the Spine atlas into a Spine project, which extracts a bunch of sprites into a folder the way Spine expects to work.
- Do skeleton animations and such using the individual images extracted.
- When ready to export, export the skeleton and repack the texture atlas. This will result in a new atlas with textures in totally different places using Spine's packing algorithm.
- Destroy the repacked atlas and just make sure the skeleton file has the same reference names and relative location to the pre-existing atlas.
The main problem with this process is that it can be fragile. You don't want to accidentally destroy your original atlas with the exported one. You also have to really understand how Atlas files and Spine work to properly get this set up in the engine. You also must carefully preserve paths and naming conventions or textures will break in the exported skeleton.
It would be awesome if Spine supported existing Atlases more natively. The functionality is all there. Extracting as individual images temporarily is fine. The only missing feature would be registering your existing Atlas with Spine and an option to auto-unpack that atlas on file change and to not overwrite it when exporting. I imagine this as a checkbox when unpacking to "preserve this atlas on export" and then Spine references assets as if they were packed but doesn't overwrite the existing texture or atlas file.
Does this make sense or is there a better way to do this that I don't know about?