- Bearbeitet
Import Adobe Illustrator Layers to Spine as PNG and JSON
Hello! Firstly I want to congratulate the developers fot this piece of awsome software!!!
Secondly I'd like to know, as I'm currently building my workflow, how to export the layers from Adobe Illustrator to Spine as PNG and JSON. I couldn't find any plugin that does that (only to export just the PNG without jSON).
Untill now I exported from Illustrator to photoshop and used a plugin from photoshop that does that but currently for illustrator I couldn't find anything. This process is pretty slow as for example if I want to change something in a sprite I have to change it again from illustrator than back to ps than back to spine. I would rather skip the ps part if its possible.
Thanks,
Alex
The Illustrator script is simplistic, as you found. The Photoshop script is much more complex, but I haven't had time to port it all to Illustrator. It is a pain maintaining multiple script for nearly the same thing, especially when Adobe breaks the scripts as they release new versions. It hasn't been the highest priority since you can bring your Illustrator images into Photoshop and use the Photoshop script.
Note you can change the images directly and Spine will pick up the changes instantly. You really only need the Photoshop script for the initial Spine import.
Thanks for the info Nate!
If you'll port it to illustrator (with json export feature) let us know. I saw that there are a few people on the internet searching for this script.
Hi guys,
I've decided to spend some time to slightly improve import script for Adobe Illustrator:
For now it:
- Checks that active doc exists and has ben saved
- Has option to explicitly ignore hidden layers, or not
- Allows to specify the output directory (using absolute or relative path)
Bild entfernt wegen fehlender Unterstützung für HTTPS. | Trotzdem zeigen
Unfortunately, this revision doesn't save settings between script runs. Approach with 'CustomOptions' doesn't work in illustrator for some reason, at least for me...
I have an idea to save settings to XMP metadata associated with document, which means that script will have "per-document" settings. But docs from Adobe are very poor, so I would appreciate if someone would give me an example how to work with XMP metadata in Illustrator.
Upd: I've figured out how to work with XMP, so now script settings will be saved between script runs. Unlike photoshop script, settings will be saved directly to document metadata, so they will be individual for each AI file. As for me, it's even more convenient
Also, i've added option to clear output folder before saving PNG files. Now you don't need to delete output files manually after changing layer name or deleting layers.
Bild entfernt wegen fehlender Unterstützung für HTTPS. | Trotzdem zeigen
Upd 2: And now PNG scaling is also supported!
Bild entfernt wegen fehlender Unterstützung für HTTPS. | Trotzdem zeigen
Good news: JSON export is also supported now! Uh-huh! I did it!
Bad news: Feature to use groups as skins isn't implemented yet...
Bild entfernt wegen fehlender Unterstützung für HTTPS. | Trotzdem zeigen
Very cool!
Thanks for sharing.
In case Nate gives it the seal of approval would it be ok with you if we included this script with Spine?
Sure, why not? Unfortunately, github doesn't support pull requests for gists, so my latest verson available here:
Feel free to include it with Spine if you want.
This is very rad! Thank you.
... do you happen to know why the JSon doesn't export when I check the box in CS6?
Edit:
Investigated some more... I'm getting this error:
"Trying to select locked or hidden art" on line 367.
Edit 2:
The issue occurred because a bunch of items was grouped together. Ungrouping them resolved the issue (if in a bit of an annoying work around).
This script is no longer a valid import!