bapho

Hi,

I don't know if this is the right place to ask about this, but does anyone have any sort of starting point or any idea about this script that I have in mind? I usually do a lot of dragging and dropping of [slots] into the same-named [bones]. So if you have hundreds of these, this can be tiresome and time consuming. Is there any script that touches on the JSON export file and can do this sort of thing?

I'm using Spine 3.4.0.2.

Thanks!
bapho
  • 記事: 48

Erika

Hello, you could do this directly in photoshop by tagging your folders with the [bone] tag.
https://github.com/EsotericSoftware/spine-scripts/tree/master/photoshop

But sure you could also write your own script :D
アバター
Erika

Erikari
  • 記事: 2964

bapho

Hi Erika,

I see, the tags however... But when exporting, the bones don't exist yet? What I do is, after exporting the PSD to PNG, I'll edit the JSON export, then copy a template bone set I have from another JSON file to the one here. Then I go about moving the bones in place on top of the parts, renaming and amending as necessary. Then once I'm happy with the bones, I just drag and drop the [slots] onto the same named [bones].
bapho
  • 記事: 48

Nate

I suppose even the groups with [bone] tags in Photoshop could be tedious to create. In 4.0.36 you can select multiple slots and click New... Bone:

Boom, it creates a bone for each of the selected slots! :ohyeah:
アバター
Nate

Nate
  • 記事: 11351

warmanw

Nate さんが書きました:In 4.0.36 you can select multiple slots and click New...
Boom, it creates a bone for each of the selected slots! :ohyeah:
NICE!
アバター
warmanw

Kickstarter Backer
  • 記事: 281

bapho

Thanks for the feedback! I can't make use of the solutions outright, however, if I were to parse the JSON, do you guys have tips on where I can start looking for answers? Like code snippets
bapho
  • 記事: 48

Nate

Parsing JSON is usually best done with whatever programming language you are most familiar with. FWIW, here is some libgdx (Java) code that parses Spine JSON, manipulates values, and writes it again:
https://github.com/EsotericSoftware/spine-runtimes/blob/4.0/spine-libgdx/spine-skeletonviewer/src/com/esotericsoftware/spine/JsonRollback.java
アバター
Nate

Nate
  • 記事: 11351

bapho

Thanks for that Nate! You got one for Javascript?
bapho
  • 記事: 48

Nate

I don't, sorry, but JSON is a subset of JavaScript and so very easy to parse there. You'll still have to work out how to read the file and write it again. That's probably pretty easy using node.js (and maybe TypeScript instead of JavaScript).
アバター
Nate

Nate
  • 記事: 11351


Return to Editor