- Editado
[Suggestion] export script new tag idea
Hi
I have a suggestion to make exporting copies of a layer easier.
Sometime when making a game scene, I would have some clones of things (trees, brench, pole, etc) on the stage. Because player could walk behind them, they cannot be merged to the background. Thus, I would have like layers tree1, tree2, tree3... waiting for export. However, this is quite tedious to rename each clones to give them unique names. Thus, my suggestion is to introduce a new tag [clone] and this is how things works:
- rename the layer to be cloned with [clone] tag. ( [clone] Tree )
- duplicate the layer as I like.
- during export, script automatically append the layer name with suffix if name already used. ( Tree, Tree2, Tree3, ...)
Thanks
Hey Spine Team, at least give me a rejection if you don't like the idea.
Hello Nick, did you already try the Path tag?
[path:name] Specifies the image file name, which can be different from the attachment name. Whitespace trimming is required. Can be used on a group with [merge].
https://github.com/EsotericSoftware/spine-scripts/tree/master/photoshop
For automatic progressive renaming of copies, there are scripts that already do this for you, such as this one:
https://blog.darkwark.com/layerRenamer/
One reason I can think of, as to why your suggestion may not be ideal is that if the PhotoshopToSpine creates the progressive numbering on export, and you re-export, you may mess with the numbering and position of the instances.
So I think making sure your layers are organized well before launching the script is a more ideal solution.
Here's another awesome PS script to rename a bunch of layers at the same time btw:
https://github.com/Paul-Riggott/PS-Scripts/blob/master/Layer%20Name%20Edit.jsx
Erika escreveuHello Nick, did you already try the Path tag?
Hi Erika, I know about the [path] tag. It only affect the file name but the slot name still need to be unique which does not solve the issue.
The main idea of this [clone] tag suggestion is to avoid any works to maintain the layer names once the [clone] tag is added. It is more on trying to solve the repeated name issue, which usually caused by cloning a layer, than making sure the attachment is pointing to the same image.
Erika escreveuFor automatic progressive renaming of copies, there are scripts that already do this for you, such as this one:
https://blog.darkwark.com/layerRenamer/
Good try but this could be worse than renaming the layers manually. Using a separate renaming addon like this require user to select all the layers before running the batch rename process plus the naming pattern setup on every execution.
For example, if I cloned a bunch of trees, corrected their layer z-orders by scattering them in the scene PSD. After a while, I decided to add more trees some where. If I am using the rename script approach, I need to find and select all the same trees to be able to run the batch rename, which could be very difficult based on the complexity of the PSD.
On the other hand, if it is using the [clone] implementation. Nothing need to be worried. The layer just need to be the named "[clone]Tree" no matter where they are, the actual export name is generated during the export process.
Erika escreveuOne reason I can think of, as to why your suggestion may not be ideal is that if the PhotoshopToSpine creates the progressive numbering on export, and you re-export, you may mess with the numbering and position of the instances.
So I think making sure your layers are organized well before launching the script is a more ideal solution.
You are right about numbering and position problem if people happen to duplicate a clone in between the existing clones and do a re-import on top of existing spine project. In reality, It is not that bad. The odd of this happening is quite low (at least from my understanding). Not to mention those [clone] layers are in theory pointing to the same cloned images. Swapping their positions shouldn't affect the result.