Nate

We've just rewritten our PhotoshopToSpine script to be much faster. It's about twice as fast for most PSDs but in some cases it's 4 or 5 times faster for large PSDs! It also fixes PNG file sizes being much larger than necessary and has a number of other minor improvements. It still works with all versions of Photoshop back to CS2.

Edit: It also has a new feature: an [overlay] tag! A layer with this tag is used as a clipping mask for all the layers below it. That means you can paint shadows/etc on an overlay layer and have them applied to all the layers below (only where there are pixels on those layers).

The overlay tag was Nick's idea and he also has an alternative tool that can do it, so check that out here:
I made an ultimate export script alternative.

Also note it can be about 10% faster if you minimize Photoshop while it's running the script. For example on Windows, press Windows+D to minimize Photoshop and show the desktop.

As always, you can get the latest script here (version 7+).

Please let us know if you run into any trouble. A lot of the code had to change to make it faster. We've tested it extensively but if you find any issues we'll be happy to fix them right away.
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 11393

Matcha

Thanks for making this amazing tool! I have one problem with the new script (I'm using v7.04). The origin in the spine is different from what I set in photoshop after scaling.

Here are the detailed steps:
  • I set the photoshop origin to the root of the human character ( somewhere in the middle of two feet )
  • I use the PhotohshopTo Spine script and set the scale to 50%
  • I got all the images in a folder and the JSON file, then import the data to Spine using the JSON file.
  • After I import the data, the character is way above the root...
  • If I set the scale to 100% in the script and export. then there's no problem. I guess there's something wrong with the scaling and the origin?
Matcha
  • Mesajlar: 2

Nate

You're right. I've committed a fix! Script version 7.05.
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 11393

eprime

Thank you!
the direct link version show 6.13 instead 7.x, it's ok?
-
Cristian Zerbinati - Eprime
Kullanıcı avatarı
eprime
  • Mesajlar: 103

Matcha

Nate yazdı:You're right. I've committed a fix! Script version 7.05.
The new version works! Thank you for the quick fix! :heart:
Matcha
  • Mesajlar: 2

Nate

eprime yazdı:the direct link version show 6.13 instead 7.x, it's ok?
No, 6.13 is old. It shows 7.05 for me. Maybe your browser is caching the file? What link are you clicking?
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 11393

skarasuko

I tried the new version, and I'm unable to perform the script successfully in CS6.
Bu mesaja eklenen dosyaları görüntülemek için gerekli yetkilere sahip değilsiniz.
skarasuko
  • Mesajlar: 90

Nate

Thanks for trying it. We've now fixed the problem (script version 7.06). Can you please try again?
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 11393

skarasuko

It's now functional. Thanks!
skarasuko
  • Mesajlar: 90

Kuro Kei

Hi Nate, i have small questions with the script, im trying to export multiple skin asset inside a folder, for example i have 5 wings skins and 5 legs skins, when export it to Spine i want them to be separated into Wing and Leg folder, with skin subfolder inside, so i try this construction
A.jpg

The script return me the folder order like this
B.jpg

as you can see it double the subfolder inside, i currently have 2 A folder and 2 B folder
Why is it happend ? Is it a bug ?
What i want is something like this
C.jpg

Thank you for reading this
Bu mesaja eklenen dosyaları görüntülemek için gerekli yetkilere sahip değilsiniz.
Kuro Kei
  • Mesajlar: 6

Nate

You're right, there was a bug! We've fixed it in script version 7.07. Thanks for the clear bug description! :beer:
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 11393

Kuro Kei

Nate yazdı:You're right, there was a bug! We've fixed it in script version 7.07. Thanks for the clear bug description! :beer:
Glad i could help, it's been driven me crazy i thought i did something wrong lol

---

Small question tho, is there any plan in the near future that the script can help us to create skin folder inside Spine Editor also, like [skinfolder:name] ? For example right now i have like 75 different skin divide into 15 group inside PTS, when i export from PTS to Spine, it's tedious to manually create skin folder again inside Spine Editor and divide them all over again.
Kuro Kei
  • Mesajlar: 6

Karias361

Not sure if this has been ask already, but any plans on making a script for clip studio exports??
Karias361
  • Mesajlar: 1

Nate

Kuro Kei yazdı:is there any plan in the near future that the script can help us to create skin folder inside Spine Editor also, like [skinfolder:name] ?
You can simply use forward slash in your skin names. Eg a/b/name will show up in Spine as a and b folders with a skin named name. I'll update the docs to make this clear.
Karias361 yazdı:Not sure if this has been ask already, but any plans on making a script for clip studio exports??
Sorry, we would love to but Clip Studio doesn't support plugins. We spoke with them hoping to get Spine support, but they weren't open to it. :(
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 11393

Kuro Kei

Nate yazdı:
Kuro Kei yazdı:is there any plan in the near future that the script can help us to create skin folder inside Spine Editor also, like [skinfolder:name] ?
You can simply use forward slash in your skin names. Eg a/b/name will show up in Spine as a and b folders with a skin named name. I'll update the docs to make this clear.
Holy.... i didnt know it, it could have saved me so many hrs :scared:
Kuro Kei
  • Mesajlar: 6

Nate

So sorry! At least it's in the documentation now so people wiki know about it.
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 11393

Scoppex

Hello,
Before I was using PhotoshopToSpine version 5. I want switch to version 7 because my file is exporing 0.5 hour on 5.x version.
Howhever I have problem bacause im getting 750 error lines like this:
Multiple layers for the "human" skin in the "weapon" slot have the same name "1":
[skin] human/global/[slot] weapon/[folder] weapons/[folder] wands/1
[skin] human/global/[slot] weapon/[folder] weapons/[folder] swords/1
[skin] human/global/[slot] weapon/[folder] weapons/[folder] wands/2
[skin] human/global/[slot] weapon/[folder] weapons/[folder] swords/2
etc...

I have same names but they are in separate folders. Before it was allowed, and now its not? It will be fixed?
Scoppex
  • Mesajlar: 10

Nate

@Scoppex Sorry for the delay. If the script allowed your setup, it would produce this:
"skins": {
"human": {
"weapon": {
"1": { "name": "human/weapons/swords/1" },
"1": { "name": "human/weapons/wands/1" },
"2": { "name": "human/weapons/swords/2" },
"2": { "name": "human/weapons/wands/2" }
}
}
}
This data shows that under the weapon slot the skin placeholders 1 and 2 each have two attachments. That isn't allowed: a skin can have only one attachment for a skin placeholder. The named used for the skin placeholder is only the layer name. The folders are used for the attachment's name under the skin placeholder.

I tried this with script version 5.9 and you're right that the script doesn't show an error, but it produced the same output I showed above. When imported into Spine, you get this:

Where is the swords attachments? Gone, because a skin can only have one attachment per skin placeholder.

Can you show the setup in Spine that you want? Then we can advise on the best way to structure your PSD.
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 11393

Scoppex

This is how my PSD was imported to spine before error in version 7.


It was ok for me because in Unity I could easly change attachments by:
skeletonAnimation.skeleton.SetAttachment("weapon", "weapons/swords/" + spineId);
My PSD structure in other places is more complicated (for armors etc.) because my character have 4 directions. Only weapons have one sprite, so showing more would be maybe too much offtopic.
Im pretty sure howhever that in other places my structure could be better that I have now:


Where: "N", "S", "E", "W" are directions and numbers 1, 2... are ID of items.
Scoppex
  • Mesajlar: 10

Nate

Thanks, that helps. Do you know what version of the script you used for that? I tried 5.9 but it didn't give those results.

---

It seems from 5.8 to 5.9 the script changed quite a bit and that's when this behavior changed. It's not clear why, as many other things changed at the same time. The change also doesn't correlate with any forum posts from users having trouble.

I've updated the script, version 7.09, so it uses the attachment name without the skin name prefix. You now get what you were looking for:
"skins": {
"human": {
"weapon": {
"weapons/wands/1": { "name": "human/weapons/wands/1" },
"weapons/wands/2": { "name": "human/weapons/wands/2" },
"weapons/swords/1": { "name": "human/weapons/swords/1" },
"weapons/swords/2": { "name": "human/weapons/swords/2" }
}
}
},
I think this is the right behavior for everyone.
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 11393

Scoppex

I have replaced this file already, but I believe it was a version 5.2.
Thank you so much. I have updated script to your 7.09 version and got no errors anymore! :grinteeth:
Scoppex
  • Mesajlar: 10

Mega1

Hi
I have been looking for hours just to find out if your scripts are compatible with Mac? but I cannot find anywhere mentioned, I looked into the GitHub page but also doesn't say anything. I tested them on mac but it shows an error when I drag the scripts into photoshop or illustrator.
Can someone point me in the right direction? as I'm not sure where to post this question.

Thank you


Here is the Pictures error when I use for example the Illustrator to Spine Script
Bu mesaja eklenen dosyaları görüntülemek için gerekli yetkilere sahip değilsiniz.
Mega1
  • Mesajlar: 3

Misaki

@Mega1 Hi, you can use the script with Mac! However, according to Adobe's official help, dragging and dropping a script file(.jsx) onto Illustrator is not a recommended way:
To execute a script, drag and drop a .jsx file onto Illustrator. However, this is not a recommended and secure way and a warning dialog is presented to alert you to prevent any accidental actions. If you still intend to execute scripts by the drag and drop action, then please follow the below steps to suppress the warning dialog: ...
Please refer to this page for more information:
https://helpx.adobe.com/illustrator/using/automation-scripts.html

I think you should open the .jsx file via File > Scripts as the help explains at the ❶ in the "Run a script" section.
Kullanıcı avatarı
Misaki

Misaki
  • Mesajlar: 238

Mega1

Misaki yazdı:@Mega1 Hi, you can use the script with Mac! However, according to Adobe's official help, dragging and dropping a script file(.jsx) onto Illustrator is not a recommended way:
To execute a script, drag and drop a .jsx file onto Illustrator. However, this is not a recommended and secure way and a warning dialog is presented to alert you to prevent any accidental actions. If you still intend to execute scripts by the drag and drop action, then please follow the below steps to suppress the warning dialog: ...
Please refer to this page for more information:
https://helpx.adobe.com/illustrator/using/automation-scripts.html

I think you should open the .jsx file via File > Scripts as the help explains at the ❶ in the "Run a script" section.
Thanks a lot @Misaki

If it's compatible with Mac then I think its a bug as I tried all the methods that they show:
1-I tried placing the jsx into the folder
Ai >>>> Presets >>> en_GB >>> Scripts
Then it shows in Ai on scripts sections but when I run it shows the same errors from the pictures that I shared above

2-I also tried to load it from manually from
>>File >>>> Scripts >>> Other Scripts >>> Choose jsx file

But the same errors acours

Not sure if this is related but is a new Mac Air with the new M1 chip just bought less than a week ago
Could be that M1 is not supported with the Spine Plugin?
Mega1
  • Mesajlar: 3

Kuro Kei

Hi Nate, i just updated the newest version of the script, but seems like it doesnt work for me
This structure used to work for me, but now it doesnt
Untitled-1.jpg

Did you remove this behavior of the script ? if so can you add it back, because in my current game i have used this structure for hundreads of skin, for example i use it to put 10 folders of skin 1~10 inside folder A, 10 folders of skin 20~30 to folder B
After i remove the [folder] group, the script work, but when i import the json in Spine, it show me error, say the json is not a valid one, error log here:
spineError.log
Bu mesaja eklenen dosyaları görüntülemek için gerekli yetkilere sahip değilsiniz.
Kuro Kei
  • Mesajlar: 6


Dön Spine