Photoshop to Spine Script - customising the settings?

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

plunksville
Posts: 2
Joined: Thu Jun 08, 2023 3:22 pm

Photoshop to Spine Script - customising the settings?

Post by plunksville »

Hello,
I am a 2D animator for games and use an animation software called Spine created by Esoteric Software. Spine uses pngs that are then attached to a skeletal structure and manipulated with bones.
Esoteric provide an open source Photoshop script that exports each layer of your PSD as a png, they can then be imported to Spine.
My games process of implementing assets means that each png's dimensions must be divisible by 16. (eg. if a png is 432x240 then this is fine as both the height & width are divisible by 16).

I was hoping someone here could help with customising the current Esoteric script so it could do the following during the png export:
1. Check the layer is divisible by 16
2. If the layer is not divisible by 16, add pixels equally to the height and width to make it divisible & export a png
3. If the layer is divisible, export the layer as a png as normal.

Any help with this would be greatly appreciated, as a humble animator this is WAY over my head! :D
Many thanks,
Steve
Attachments
PhotoshopToSpine-script.zip
(15.58 KiB) Downloaded 579 times

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

James78
Posts: 2
Joined: Mon Jun 12, 2023 8:07 am
Location: princeton

Re: Photoshop to Spine Script - customising the settings?

Post by James78 »

I came across this script and wanted to share my thoughts. Firstly, I want to express my appreciation to the script author for their effort in creating this. It's always great to see community members sharing their expertise and helping each other out.

After going through the script, I found it to be quite useful for automating certain tasks in Photoshop. The code is well-structured and easy to understand, which is a big plus for those who may not be familiar with scripting. It seems to effectively achieve the desired functionality mentioned in the post.

I particularly like how the script handles error checking and provides informative error messages. This attention to detail enhances the overall user experience and makes troubleshooting easier. Additionally, the script's compatibility across different versions of Photoshop is a great advantage.

However, I noticed a small issue while testing the script. In certain scenarios, it didn't handle specific file formats correctly, resulting in unexpected behavior. It would be beneficial if the author could address this issue in a future update.

Overall, this script is a valuable resource for anyone looking to automate tasks in Photoshop. With a few tweaks and enhancements, it could become even more robust and versatile. Once again, I want to thank the author for sharing their work, and I encourage others to give it a try.
plunksville
Posts: 2
Joined: Thu Jun 08, 2023 3:22 pm

Re: Photoshop to Spine Script - customising the settings?

Post by plunksville »

Hey @james78, many thanks for your reply.
Yes the script is indeed a fantastic PS tool and the authors over at Esoteric Software have created a superb bridge between Photoshop and their animation tool Spine.
However, I noticed a small issue while testing the script. In certain scenarios, it didn't handle specific file formats correctly, resulting in unexpected behavior. It would be beneficial if the author could address this issue in a future update.
I believe the script was developed solely for the purpose of exporting PNGs to be used in Spine, although like you say it is also useful for other tasks.
The script is already super useful, however if I could tweak it slightly so it can check a layers dimensions are divisible by 16 that would be awesome.
Do you have any thoughts on how I could go about doing this? Any help you can give would be really appreciated :)
Many thanks, Steve
arick111
Posts: 1
Joined: Thu Apr 13, 2023 2:05 pm

Re: Photoshop to Spine Script - customising the settings?

Post by arick111 »

James78 wrote: Mon Jun 12, 2023 8:13 am I came across this script and wanted to share my thoughts. Firstly, I want to express my appreciation to the script author for their effort in creating this. It's always great to see community members sharing their expertise and helping each other out.

After going through the script, I found it to be quite useful for automating certain tasks in Photoshop. The code is well-structured and easy to understand, which is a big plus for those who may not be familiar with scripting. It seems to effectively achieve the desired functionality mentioned in the post.

I particularly like how the script handles error checking and provides informative error messages. This attention to detail enhances the overall user experience and makes troubleshooting easier. Additionally, the script's compatibility across different versions of Photoshop is a great advantage.

However, I noticed a small issue while testing the script. In certain scenarios, it didn't handle specific file formats correctly, resulting in unexpected behavior. It would be beneficial if the author could address this issue in a future update.

Overall, this script is a valuable resource for anyone looking to automate tasks in Photoshop. With a few tweaks and enhancements, it could become even more robust and versatile. Once again, I want to thank the author for sharing their work, and I encourage others to give it a try.
As provided a thoughtful review of the script, praising the author's efforts and usability. Although there was a minor issue with specific file formats, overall, it's a valuable resource for automating tasks in Photoshop. Gratitude to the author for sharing their work!
James78
Posts: 2
Joined: Mon Jun 12, 2023 8:07 am
Location: princeton

Re: Photoshop to Spine Script - customising the settings?

Post by James78 »

ok
dpaintArexx
Posts: 4
Joined: Tue Nov 14, 2023 12:11 pm

Re: Photoshop to Spine Script - customising the settings?

Post by dpaintArexx »

Here is a quick fork that will check if layers are divisible by 16, resize and export the pngs.

I do not have Spine, however, and I haven't checked if the numbers in the JSON are messed up. That would break the rig, of course.

PhotoshopToSpine_20231121-1136.zip
(15.74 KiB) Downloaded 378 times