- Modifié
Sharing atlases between skeletons (moving/renaming atlases)
In our current project, we have multiple separate skeletons that all use identical atlases. (The skeletons are separate to make things easier on the animators.) Having all of these identical atlases (or more specifically, their textures) is a big waste of space in the project; these are enormous 4K textures, and it would be vastly preferable to have only one of each, rather than having so many duplicates.
I have successfully made two spines use the same atlas, and have started writing an editor script to automate the process; however, many many parts of Spine's Unity codebase rely on the idea that atlases (and their textures) will always have an identical filename to the skeleton, and will be found in the same directory as the skeleton. I've been hacking away at the codebase to try and accommodate this new approach, but I'm still hitting unpredictable problems like spines turning invisible when their assets are updated, or references all breaking whenever the editor is closed and then re-opened. I could keep chasing all these weird bugs (this is just the latest wave of them), but I think at this point I should ask whether this is a solved problem already; is there any recommended way for multiple SkeletonData assets to all use a single Atlas, such that nothing involved will break or lose its references when any of the assets involved are updated on disk and trigger a reimport?
Just to follow up
I've started suspecting that I'd have more luck if I exported the skeleton and the atlas from spine as two separate operations, with each one already named the way that I want, rather than awkwardly trying to rename assets in an atlas that was expecting them to be named differently. The issue that I'm running into with that approach is: how do I know which atlas to assign to each skeleton, if I'm trying to do this in an automated way? There seems to be no way to query a .spine file from the CLI, for information like "what folder does this skeleton source its assets from"?
We are sorry for the troubles! Which version of the spine-unity runtime (name of the unitypackage, also listed in the Assets/Spine/version.txt
file) are you using? We have very recently improved some import related code, so you might want to give the latest package a try.
If the problem still persists after the update, please let us know, then we would be happy to fix this issue. Could you then please send us a minimal Unity project that still shows the issue? You can send it as a zip package to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context. Then we can have a look at it.
The version file says:
This Spine-Unity runtime works with data exported from Spine Editor version: 4.0.xx
Package version: spine-unity-4.0-2021-09-17.unitypackage
What were the import-related changes, is there a changelog I should look at?
Regarding bugfixes, you can find a list of all spine-unity relevant commits via the history of the spine-unity directory in github:
https://github.com/EsotericSoftware/spine-runtimes/commits/4.0/spine-unity
As you can see, there has been a whole page of bugfixes since your package version 2021-09-17.
Apart from bugfixes, you can find additions and the like in the changelog.md file:
https://github.com/EsotericSoftware/spine-runtimes/blob/4.0/CHANGELOG.md#unity
https://github.com/EsotericSoftware/spine-runtimes/blob/4.0/CHANGELOG.md#c-2