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

Related Discussions
...

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.

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:

9 jours plus tard

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

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

Misaki a écrit

@[supprimé] 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?

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

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 110 inside folder A, 10 folders of skin 2030 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

@[supprimé]

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?

As for PhotoshopToSpine, it works on M1 Mac. (I use a Macbook Pro with the M1 chip.)
However, Illustrator to Spine has not been updated for about 4 years, so there is a possibility that we should update something for newer Illustrator versions. I'd like to make an issue ticket on github, so could you tell me what version of Illustrator you are using?

Also, have you tried to use PhotoshopToSpine via File - Scripts - Other Scripts - Choose jsx file?


@Kuro Kei
Thank you for your reporting, we reproduced the bug and I made an issue ticket for this problem:
https://github.com/EsotericSoftware/spine-editor/issues/608

However, if I delete the layer group that using [folder] tag, it can be exported. Also, the exported files can be imported to Spine Editor without any problem. Therefore, could you send us the PSD that the problem occurred via email ( contact@esotericsoftware.com)? We'd like to verify the PSD.

Is there an export plug-in for Figma, similar to Photoshop to Spine script, Figma is an amazing design tool, I usually use it a lot . 😉

I'm afraid there's currently no such plugin. We are thinking about ways to make such plugin creation easier and more robust across a multitude of editing software. But that will take some time.

5 jours plus tard
Misaki a écrit

As for PhotoshopToSpine, it works on M1 Mac. (I use a Macbook Pro with the M1 chip.)
However, Illustrator to Spine has not been updated for about 4 years, so there is a possibility that we should update something for newer Illustrator versions. I'd like to make an issue ticket on github, so could you tell me what version of Illustrator you are using?

Also, have you tried to use PhotoshopToSpine via File - Scripts - Other Scripts - Choose jsx file?

Hi @Misaki sorry for the late replay I don't get notifications from this forum when someone tags me

Hoh I see that explains why it doesn't work on illustrator

We use the latest version of Illustrator v26.0 it just came out

Also, for the Photoshop Spine plugging, it works perfectly with the latest photoshop version on the Mac M1 Chip
Though it has just a minor thing not sure if that is a bug or not but is not a big deal for us, is that if you open a project with one picture and the layer is locked and you try to export with the Spine plugin then it will show and error. To fix that you need to unlock the layer.
Is not a problem for us as it has an easy fix but I thought to let you know just in case.

Thank you very much for your help ))

Hi, @[supprimé]
Thank you for your information, I'm glad to hear that you can run the script in the latest Photoshop!
However, I couldn’t reproduce the lock problem that you've reported to us. If you don’t mind, could you send us the PSD file via email? : contact@esotericsoftware.com

Regarding Illustrator, I’ve made an issue on GitHub according to your information :
https://github.com/EsotericSoftware/spine-editor/issues/611
Thank you for your cooperation!

Hello,

I tried to use and debug the new script (v. 7.09) but I'm unable to run this successfully in both Photoshop 2020 (21.2.2) and Photoshop 2021 (22.0.0)...
The behavior is the same in both applications: Photoshop just crashes after clicking "Ok"/running the function "run".

I'm not aware of a way of using the AdobeExtendScriptToolkit debug functionality after the dialog appears so I used the old way of using alerts in multiple places of the script to see the behavior after running the "run" function. But it's being hard to see where exactly the problem is since I can run the script in the same PSD (I'm currently using a very simple PSD, which only contains a simple white layer and a color fill layer) two times and have a different behavior somehow (sometimes it triggers the alert that I put before the first definition of the "placeholders" variable and sometimes doesn't, for example.) I was even able to run it successfuly once or twice without Photoshop crashing.

I don't know if this helps in any way but I also have this warning: http://en.esotericsoftware.com/forum/Photoshop-to-Spine-Print-Error-14426

Is there a way for you guys to help me debug this or for me to help you guys try to figure out where the problem is?

Also, is there any way to make Photoshop work with Spine without the script?

Thank you so much,

Nigran

un mois plus tard

Hi Nigran, sorry we missed your post! Photoshop crashing is unfortunately an Adobe problem. A script should never be able to crash their whole program. We'd be happy help find a workaround though. It sounds like you are on the right track to debug the problem. That it crashes in different places and even sometimes succeeds makes it extremely difficult to figure out.

Have you tried a simpler PSD? Just one layer, no color fill. Otherwise I'm not sure what else to try. You could try an older version of the script, like 6.13. You can try holding ctrl+alt+shift when starting Photoshop to reset all its the settings.


@Kuro Kei, we've fixed the problem you were having:
https://github.com/EsotericSoftware/spine-editor/issues/608


The latest Photoshop script 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).

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

Hi @Nate,

Thanks a lot for the reply and for trying to help!

I downloaded the 6.13 version and tried it, together with the version I already had (I saw in your comment that there's a new version now, I still need to try it) just to check it once again, and I'm glad to say that it somehow works nicely now! I don't know why since no version changed but that's great news, it never crashed again.

Below are the notes I have, it always had the same behaviour in both versions from what I have noticed:

  • The images I have clipped to folders are exported as a full black image
  • The error "The command 'Merge Layers' is not currently available" appears sometimes. When that happens I just need to manually merge the layers. It seems to only happen when a layer is clipped to another one

Both cases are fine since Spine, from what I know, is just to animate and I don't think that will be an issue since clipped layers usually happen for static images (in my experience at least.) I think that those things outside the animation itself are never to be made inside Spine. In any case the last version, with the "[Overlay]" tag, might help with that already.
(Please correct me if I said anything wrong)

TL;DR: It seems like I have no issues right now! Thank you and continue your great work 🙂

Best Regards,

Nigran

We'll chalk it up as a mystery I guess! I'm glad it's working though. 🙂

3 mois plus tard

What contributes the most to the script execution speed? The CPU?

Yes, it's mainly the CPU that determines the script execution speed. Also avoid network drives whenever possible.

You can try a bit of voodoo: run the script then minimize the window, or at least focus a different window so Photoshop is in the background. This can sometimes allow the script to run maybe 10% faster.

The problem with the script running quickly on any computer is Photoshop


it's a giant piece of junk. 🙁 The scripting works but is barely documented and the normal APIs provided are terribly slow. We rewrote the script using the lowest level APIs available and we came up with many tricks to gain a little speed here and there. It's still not fast, but it's as fast as Photoshop can be.

un mois plus tard

Hello
this script is so handy. Really essential to work effectively.
I just notice that the [overlay] tag doesn't work properly with layers nested in [folder]>[slot]>[merge] folders. The background of the pngs should be transparent, and it's not. Other than that, it's perfect. (Photoshop CC2019, MacOSX)
Edit : it's random, sometimes it works, sometimes not.
Edit2 : works well when folders [folder] and [slot] are expanded in Photoshop.

@Tomateche Hello, thank you for reporting the issue. Unfortunately, I could not reproduce the issue you described. I created a PSD like this based on your report:

However, I was able to export it without any problems whether I expand or collapse the folders(groups).

I have attached the PSD here, so that you can see if this one can be exported without any problems:
overlay-tag-test.zip
We would appreciate it if you let us know what the differences are between this and your PSD.