- Düzenlendi
Photoshop to Spine to Skin Folder
I am running into an issue with the PhotoshopToSpine export, and I'm not sure if it's because I'm using group and layer tags incorrectly.
In Photoshop, I have groups with layers like this:
[folder] eyes
[slot:eyes] [skin] eyes1
[slot:eyes] [skin] eyes2
After exporting, I would expect the images to go to this folder structure:
images/
eyes/
eyes1.png
eyes2.png.
However, the images get exported to:
images/
eyes1/
eyes/
eyes1.png
eyes2/
eyes/
eyes2.png
Also, after importing to Spine, I would expect the eyes1 and eyes2 skins to be in an 'eyes' Skin folder. But they show up as skins in the root skins listing, with no sub-folder.
Am I misapplying the tags in Photoshop?
I'm running into a further issue with export of photoshop to skin, and I'm still pretty sure it's because I'm not using tags correctly, but I'm having a hard time figuring out where I've gone wrong. I'll step back a pace or two to describe my intentions first, in case that makes it any easier for someone else to see where I'm getting confused.
I have a libGDX project where I create a skin at runtime from multiple "mix-and-match" style skins. For example, the "eyes2" skin has only an "eyes2.png" in the eyes slot, and then when the runtime code selects the "eyes2" skin, it can add that part to a composite skin.
I have been able to set up a skeleton that works with this system through manually importing images, creating slots, attachments, and skins, but I can't seem to get a workflow working with photoshop export. In addition to the issues above (which are a little bothersome for organizing, but don't stop me from proceeding), I am running into an issue where images exported to the same slot only show the first image in Spine. For example:
In Photoshop, these layers:
[slot:eyes] [skin] eyes1
[slot:eyes] [skin] eyes2
...are imported to Spine as two skins, (eyes1 and eyes2), with two different skin placeholders within one slot (eyes). After import, the eyes1 skin and attachment is visible
All of this seems by design, so far so good. But if I select the eyes2 skin, the eyes2 attachment is not visible. Instead, the eyes1 skin placeholder retains its visibility toggle.
If I toggle the eyes2 placeholder + attachment to be visible, and then switch back to the eyes1 skin, the eyes1 attachment is no longer visible for the eyes1 skin.
Is this a bug? Or am I misunderstanding how to set up skins with Photoshop export?
Hello bellow!
To answer your questions, the skins folders will always enclose the other folders if you use the current script (you can modify the script code manually if you prefer). The reason for this is that packing per skin makes usually more sense, and if you need to mix and match a large number of items it would be better to generate an atlas at runtime with only the items you need. Setting that up is complicated but enables any number of attachments, which you don't even need to have to pass through Spine.
The trick to getting images to reuse the same skin placeholder across different skins is to call the layers with the same names.
For example:
[skin:eye1] eye
[skin:eye2] eye
Would result in two skins, eye1 and eye2 that in the slot eye would have a skin placeholder where both images would be placed in, and only one would be active depending on the selected skin, getting the setup you were after.
I think it's also important to notice that if you use the [skin] tag and don't specify the skin name, the attachment name will be used both for the attachment and the skin, which may not be desirable if you wish to reuse skin placeholders.
Hello Erikari!
Thank you for all the very helpful explanation. That does clear up a lot, and I think that will get me going with the workflow I'm trying to put together. As I go forward I will look more into generating the atlas at runtime, that sounds like a very promising solution too.
Thanks again!