broderick.nathan

Hello!

As you know, PhotoshoptoSpine.jsx creates a template.png when you tick the "write template" checkbox.
However, this image is not written to the .json file, and therefore not brought into spine and placed correctly.

I am not sure why a person would save a template image using this script if they weren't trying to use it in their spine file.

So, I went ahead and fixed the script. See attached script which imports and places the template.png into spine via json. It'd be nice to have this feature be officially supported in a future update of the script. My major changes occur around line 226 and 256 of my script.

-Nathan
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.
broderick.nathan
  • Messaggi: 4

Nate

It seems you used an older version of the script. The latest version is here:
https://github.com/EsotericSoftware/spine-scripts/tree/master/photoshop#download

It makes sense to include the template in the JSON, but it's a little tricky to make sure there aren't any naming conflicts. There can't be another slot or image file named template.
Avatar utente
Nate

Nate
  • Messaggi: 12040

broderick.nathan

You bring up a good point about naming.

However, I think the original issue still stands:
"I am not sure why a person would save a template image using this script if they weren't trying to use it in their spine file."

Is there a better solution than just naming the slot 'template'?

edit: Now that I'm thinking about it....isn't this already an issue? The script saves template.png. Well, what if I had a slot named template. Then, the slot would save over the template, and the result would be no template image. The script wouldn't be doing what it said it would when I ticked the box. A lesser problem than the one you pointed out, and definitely an edge case. Perhaps the script could check to see if any layers were named 'template' before starting.
broderick.nathan
  • Messaggi: 4

Nate

True, I'm not sure what the usefulness of the template is, even if it were in the JSON data, when you are also bringing all the images into Spine in the right positions. Generally I would expect a template image to be used when manually positioning attachments. Maybe someone finds it useful to hide some attachments, then show the template in the background so they can position other things.

Using the name template is OK, but we'd need some code to check if the name is already used, then we could tack on a 2 and check again, then a 3, etc.
Avatar utente
Nate

Nate
  • Messaggi: 12040

broderick.nathan

Ah, that's a good solution.

Well, at my company at least, the template is nice because sometimes there are changes to the art after it's already been in spine. Like, the length of the arm might change. So, it's nice to have the template as a reference when importing the new arm. I dunno, some people really like it.
broderick.nathan
  • Messaggi: 4

Nate

Makes sense!

Would you like to give the naming checks a try? If not we can create an issue and get it done next we get a chance. Checking is needed for the template image file name and the slot name.
Avatar utente
Nate

Nate
  • Messaggi: 12040

broderick.nathan

Agh, you know, I gave it a shot, but I'm not a professional software engineer, and I was having trouble following the structure of the up-to-date spine script.

Thanks for listening to my feedback. I suppose I'll just have to wait until you guys have time to implement.
broderick.nathan
  • Messaggi: 4


Torna a Editor