Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Adobe Photoshop script to export to Esoteric Software's Spine: http://esotericsoftware.com/
Please note this script has moved: https://github.com/EsotericSoftware/spine-scripts
@apiiipz

This comment has been minimized.

Show comment
Hide comment
@apiiipz

apiiipz Nov 6, 2014

open program (adobe extendscript toolkit) ---> copy paste this script --> save as

apiiipz commented Nov 6, 2014

open program (adobe extendscript toolkit) ---> copy paste this script --> save as

@tayl0r

This comment has been minimized.

Show comment
Hide comment
@tayl0r

tayl0r Nov 9, 2014

I'm using PS CC 2014.2.1 on Windows 8.1 and when I run this script the exported PNGs are all messed up. I get this:

And here are my PSD layers + export screen (note, I've tried all kinds of different options, all with basically the same result):

It's working for another artist on my team who using PS 14.0 x64 on OSX. Any ideas on what the problem could be, how to fix, or what I could do to debug?

tayl0r commented Nov 9, 2014

I'm using PS CC 2014.2.1 on Windows 8.1 and when I run this script the exported PNGs are all messed up. I get this:

And here are my PSD layers + export screen (note, I've tried all kinds of different options, all with basically the same result):

It's working for another artist on my team who using PS 14.0 x64 on OSX. Any ideas on what the problem could be, how to fix, or what I could do to debug?

@fserb

This comment has been minimized.

Show comment
Hide comment
@fserb

fserb Nov 9, 2014

I'm getting the same thing as @tayl0r with PS CC on Mac.

fserb commented Nov 9, 2014

I'm getting the same thing as @tayl0r with PS CC on Mac.

@pinkart

This comment has been minimized.

Show comment
Hide comment
@pinkart

pinkart Sep 21, 2015

how to download

pinkart commented Sep 21, 2015

how to download

@kamil-badalov

This comment has been minimized.

Show comment
Hide comment
@kamil-badalov

kamil-badalov Dec 8, 2015

Png export is fine. But json is empty. What should I do?

Png export is fine. But json is empty. What should I do?

@MintyMerry

This comment has been minimized.

Show comment
Hide comment
@MintyMerry

MintyMerry Dec 22, 2015

This script is a great time-saver! Especially with the set ruler 0,0 as origin feature :")

Would it be possible to add a feature that would define which (Spine) slot each layer would be exported into? For example, if we have a couple frames for a blinking animation with the following layers:

  • Eyes_closed
  • Eyes_open
    It would be nice to skip the extra drag, drop, and rename steps if they can be exported into the same slot, named Eyes.

This script is a great time-saver! Especially with the set ruler 0,0 as origin feature :")

Would it be possible to add a feature that would define which (Spine) slot each layer would be exported into? For example, if we have a couple frames for a blinking animation with the following layers:

  • Eyes_closed
  • Eyes_open
    It would be nice to skip the extra drag, drop, and rename steps if they can be exported into the same slot, named Eyes.
@adankoala

This comment has been minimized.

Show comment
Hide comment
@adankoala

adankoala Mar 19, 2016

Updated the script but i think is not the problem with the script, Png export is ok but i can't open it on Spine, the images are missing, i can't work for now !!! any advice on the new update from Spine? before it was all working fine !!!
I have a MacBook Pro (17-inch, Late 2011) all up to date. :(
untitled-1

Updated the script but i think is not the problem with the script, Png export is ok but i can't open it on Spine, the images are missing, i can't work for now !!! any advice on the new update from Spine? before it was all working fine !!!
I have a MacBook Pro (17-inch, Late 2011) all up to date. :(
untitled-1

@iamdash

This comment has been minimized.

Show comment
Hide comment

iamdash commented May 24, 2016

+1

@ryanreptoid

This comment has been minimized.

Show comment
Hide comment
@ryanreptoid

ryanreptoid Jun 6, 2016

I'm also having the broken image issue. Any ideas?
broken

I'm also having the broken image issue. Any ideas?
broken

@ryanreptoid

This comment has been minimized.

Show comment
Hide comment
@ryanreptoid

ryanreptoid Jun 6, 2016

Figured it out: you need to browse to the folder you exported images to. This fixes it! @adankoala
browse

Figured it out: you need to browse to the folder you exported images to. This fixes it! @adankoala
browse

@Jordimlaka

This comment has been minimized.

Show comment
Hide comment
@Jordimlaka

Jordimlaka Aug 23, 2016

Hi,

This script saves the PNG with the color profile incrusted?, when the graphics is showed into Spine, these graphics cannot conserve the color profile aplied in photoshop.

Any ideas?

For other hand, i want to put one bone for each slot automatically when i export from psd, how can i have edit the script to do this?

Thanks.

Jordimlaka commented Aug 23, 2016

Hi,

This script saves the PNG with the color profile incrusted?, when the graphics is showed into Spine, these graphics cannot conserve the color profile aplied in photoshop.

Any ideas?

For other hand, i want to put one bone for each slot automatically when i export from psd, how can i have edit the script to do this?

Thanks.

@BethHicks

This comment has been minimized.

Show comment
Hide comment
@BethHicks

BethHicks Jan 6, 2017

This is a total noob question, but i rarely use scripts... now I have saved it into my extendscript toolkit... not even sure if i did it right. lol. how do i actually run the script to get the files i need to get them to show in Spine? Here's an image of my layer setup...

layer setup

This is a total noob question, but i rarely use scripts... now I have saved it into my extendscript toolkit... not even sure if i did it right. lol. how do i actually run the script to get the files i need to get them to show in Spine? Here's an image of my layer setup...

layer setup

@AlexMaan

This comment has been minimized.

Show comment
Hide comment
@AlexMaan

AlexMaan Jan 26, 2017

Hello guys,

Error importing skeleton.
I had message when you import files from a photoshop - An error occurred while importing yhe skeleton.
import_error
Sptires also did not appear.
import_sprites_error
I decided to deal with the .JSON file and found the cause of the error:
Setting - sprite size - using fractional values and added an extra comma (like (x,5,y,z,)), so JSON did not load correctly.
To fix this bug I use nopad-find&replace command, but it`s not very convenient, maybe you can take into account this case in your Script.
json_comma_error

Thanks

Hello guys,

Error importing skeleton.
I had message when you import files from a photoshop - An error occurred while importing yhe skeleton.
import_error
Sptires also did not appear.
import_sprites_error
I decided to deal with the .JSON file and found the cause of the error:
Setting - sprite size - using fractional values and added an extra comma (like (x,5,y,z,)), so JSON did not load correctly.
To fix this bug I use nopad-find&replace command, but it`s not very convenient, maybe you can take into account this case in your Script.
json_comma_error

Thanks

@skpadayatchi

This comment has been minimized.

Show comment
Hide comment
@skpadayatchi

skpadayatchi May 3, 2017

Hi,
How can i do this for CS5 version of photoshop?

Hi,
How can i do this for CS5 version of photoshop?

@leonidumanskiy

This comment has been minimized.

Show comment
Hide comment
@leonidumanskiy

leonidumanskiy Jul 15, 2017

This script will fail to write a json file if one of your layers have non-english characters in the layer name.
To fix this, you need to add:
file.encoding = "UTF-8";
between creating a new file object using "new File" and calling file.write().

Please use my fork for the fixed version.

This script will fail to write a json file if one of your layers have non-english characters in the layer name.
To fix this, you need to add:
file.encoding = "UTF-8";
between creating a new file object using "new File" and calling file.write().

Please use my fork for the fixed version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment