Sometime we will have a layer reused on different places in the PSD. The preferred handling from spine is to recreate the art with multiple attachments point to the same image. So my suggestion is to add a tag to handle duplicated name and treat them as referencing the same exported part. Right now, duplicated names are treated as error.

example in PSD:
Layer 23 : [ref]Candle
Layer 25 : [ref]Candle

since they have same name with [ref] tag, exported json would create two attachment pointing to the same Candle.png but with different position as in PSD. if attachment are not allowed to have same name, they could just be named with layer number, say Candle23, Candle 25 (or just use a counter and create Candle1 and Candle2)

Alternatively, we can also use a naming format with a separator to indicate the export image name and the attachment name:
Layer 23 : [ref]Candle1@Candle
Layer 25 : [ref]Candle2@Candle

Both ways will work.
Any suggestion on this is welcome.
  • 帖子: 75


I suggest using [ignore] on all but one of the layers. We have [ignore] already, so not much point adding a new tag for this case. We considered automatically detecting if two layers are the same, but it's difficult to do with Photoshop script (everything is difficult with Photoshop script :wounded: ).


Ah, [ignore] won't add the attachment again of course. We'll consider something to solve this.


We've updated the script to support [path:name] tags. You'd use it like this:
Candle1 [path:Candle]
Candle2 [path:Candle]

You can get the latest script here:
spine-scripts/photoshop at master · EsotericSoftware/spine-scripts

Cheers! :beer:

  • 帖子: 9207

回到 Editor