• Editor
  • PhotoshopToSpine script: faster + new [overlay] tag

  • Bearbeitet
Related Discussions
...

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.

8 Tage später

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?

You're right. I've committed a fix! Script version 7.05.

Thank you!
the direct link version show 6.13 instead 7.x, it's ok?

Nate schrieb

You're right. I've committed a fix! Script version 7.05.

The new version works! Thank you for the quick fix! :heart:

eprime schrieb

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?

I tried the new version, and I'm unable to perform the script successfully in CS6.

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

It's now functional. Thanks!

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

The script return me the folder order like this

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

Thank you for reading this

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

Nate schrieb

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.

6 Tage später

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

Kuro Kei schrieb

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 schrieb

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

Nate schrieb
Kuro Kei schrieb

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:

So sorry! At least it's in the documentation now so people wiki know about it.

5 Tage später

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 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:

Bild entfernt wegen fehlender Unterstützung für HTTPS. | Trotzdem zeigen


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.

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.