- Editado
[suggestion] PS export script canvas clipping issue
I use spine for both character and scene animations. One issue I found is that when I export scene PSD, it is quite often clips away part of my layers (e.g. trees ) during export because the part of the layers is outside the canvas.
The incomplete export make it not desirable to animate. For example, I have a tree in a scene. I want to animate wind blow on the leaves. Since half of it is outside the canvas region, the missing part of the tree limited the deform toward only one direction or otherwise it would show a part of the tree is missing.
The suggested solution is actually quite simple. Before the script do the export, check the position and dimension of the visible layers first and calculate the minimum content size to cover all the pixels. After that, increase the PSD canvas size accordingly before export. In theory, that will not clip away pixels outside the canvas. The exported origin need to be corrected when canvas size is increased to fit content size.
Hi Nick,
The solution can even be simpler: just enlarge your canvas enough to make all the parts visible in Photoshop.
Photoshop always had canvases and has never been able to export parts outside of it when, say, you export a png or similar. If you kept the two guides to remember the ruler origin position, it should be a piece of cake to re-export just the layers that got cut because of it.
Haha, I am suggesting this change to the export script is because I am already doing what you mentioned every time I found the issue occurs... I also tried keeping the file canvas larger all the time. However, small problems happens. Artist no longer having a hard boundary to limit the actual needed canvas size which make the base background and some other static things to export larger than needed size. In this case, an extra step to clip those non-animated layers back to minimum size is needed. It would also make file thumbnail less readable due to the extra spacing.
The only way to solve this issue perfectly without user intervention is to have the script do it smartly during export. Note that I am aiming at perfection on the workflow not workaround. I don't expect this to be implemented soon but just want Spine team to take note that this issue can be improved like this.
Sorry I'm late to the party. I think it would be surprising to enlarge the canvas so layers aren't cropped because, as Erika mentioned, it's the expected behavior for other Photoshop exports to crop such layers. It's not hard to add such functionality though, so we've added it as a commented out line of code in the latest script, version 5.3:
https://github.com/EsotericSoftware/spine-scripts/blob/master/photoshop/PhotoshopToSpine.jsx#L57
If it turns out that it's commonly used, we could make it a checkbox.
Hi Nate, thanks for the update.
Sometimes people don't know if they need a feature unless you show them such feature is available. If it is implemented, I definitely think it should be added as a setting. No to mention the people (just me atm...) who need this feature will need to edit the script every time the script get updated.
That is true, but it is also not good to add too many features. It can make things hard to use when there are many features that very few people need. We could add a section to the documentation.