Dean_Sim ha scritto1) For each and every character, move our skin images into a common image folder of that character (So that folder contains all images for that character) and then change the images path for the skin images in my Spine project to point to the common images folder of that character.
Your wording is not super clear. You'd move the images so all characters are under a single folder, eg the folder named root
here:
root/character1/red/head.png
root/character1/green/head.png
root/character2/red/head.png
root/character2/green/head.png
Then you'd change the images path
under the Images
node in the tree for all your projects to point to the root
folder. Your attachments need to be named to match so images path
+ /
+ attachment name
+ .png
resolves to the image file. For example, your attachment name needs to be character1/red/head
(because root
+ /
+ character1/red/head
+ .png
finds the image). You can use Find and Replace to quickly add the character1/
prefix to all attachments (enable regex, find (.+)
, replace with character1/$1
). Or you can name a Photoshop group character1 [folder]
and place your layers in that group, that way the images exported from Photoshop are in the right place.
This setup allows you to pack the root
folder, which will give you an atlas where regions will be found correctly at runtime. Do not use flatten paths
. Do use combine subdirectories
if you don't want the folders to put images on separate atlas pages.
There could be a 4th option: write a shell script to copy your image folders from wherever they are into a single folder. Eg, if your folders look like this:
somewhere/character1/images/red/head.png
somewhere/character1/images/green/head.png
somewhereelse/character2/images/red/head.png
somewhereelse/character2/images/green/head.png
The script would copy them to:
root/character1/red/head.png
root/character1/green/head.png
root/character2/red/head.png
root/character2/green/head.png
The shell script would then pack the root
folder. As above, in the atlas the regions would have names like character1/red/head
. In your Spine projects you would be using the character specific images folder (eg somewhere/character1/images/
) so your attachment names would have paths like red/head
. That means at runtime it would look for red/head
in the atlas. To remedy that you would write a little code that prepends the skeleton name. For example for a skeleton named character1
it would look for character1/red/head
.
This approach allows each project to have its own image folders, the downside being you have to write a shell script to assemble the atlas, plus write a little code at runtime.
Dean_Sim ha scrittoIt seems like there should be an option for texture packer when using combine subdirectories and subsequently flatten paths to exclude removing established skin folder names when exporting the atlas.
I think it is better to know exactly what the packer will do: it will either flatten paths or not. Having it flatten paths, but not if the path is a folder for a skin seems more complicated than necessary.
Dean_Sim ha scrittoI feel like it would be nice for the features to work together in this manor as I am sure others are working on projects with folders for characters with skins and would like have it all work out of the box without having to work around it in this manor.
We are open to suggestions on how things can be improved, though I don't think making combine subdirectories
/flatten paths
more complicated is the way to go. I suggest not using flatten paths
at all, as it is making things harder than they should be. I suggest the approach above where you place all images in a root
folder and pack that. That is the simplest way to organize your images and name your attachments, then you just pack and use the atlas at runtime.