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.
Thanks