• Editor
  • Issues with linked meshes + photoshop script, please help!

  • Изменено
Related Discussions
...

Hi! Thanks for the new 4.0 update, it's quite good!

I'm using linked meshes to speed up my workflow, but I'm running into issues.

First a few questions. Am I correct in assuming that:

  • Linked meshes are intended to work only with images of exactly the same size (actually: aspect ratio)?
  • There is no way to re-align an image to an linked mesh?

The following is my issue:

Assuming that linked meshes need always work with the same texture dimensions (not an issue for me), the PhotoshopToSpine script doesn't allow me to properly do this. Turning off "trim whitespace" uses the documents bounds, which is much, much larger than any individual component and very wasteful.

Solutions on the photoshop-script side would be:

  • To allow the texture bounds to be based on a different image with a tag: [bounds: name_of_other_image]
  • To respect the photoshop 'mask' feature (see image above). This is how the built-in Photoshop Generator allows custom bounding boxes.

Solutions on the Spine editor side would be:

  • To allow translation and scale offset between the linked mesh and the new image.

Maybe I've totally missed a feature, I'm pretty new to linked meshes!
Thanks in advance,
Maarten

https://github.com/EsotericSoftware/spine-editor/issues/551

Waarten написал

Am I correct in assuming that:

Linked meshes are intended to work only with images of exactly the same size (actually: aspect ratio)?

There is no way to re-align an image to an linked mesh?[/quote]

Yes you are correct: linked meshes were intended for images matching to the pixel in size, and it is only possible to edit the source mesh, so a result like your example on the left is what could happen.

If you enable "trim whitespace" on export, the script will try its best to trim that whitespace regardless of masks, yes. You could disable it, but that would come with all the images being as wide as the canvas, so not exactly convenient.

A workaround some people use is to manually paste the new image in a copy after exporting to get that extra space where needed.

A second workaround consists in placing one traslucent pixel in each corner so that the size can match, and then making sure that pixel is not in the mesh area so that it won't be visible.

A third workaround is to have the source mesh without ears, so that the actual parts that can be reused are reused, and the ears can be on a separate level.

Regarding your suggestions to improve the script, I'll relay them to Nate! I'm not sure they can actually be implemented, but they sure would be convenient! We do have it for image paths, so perhaps this may be possible?

We do have some improvements planned for mesh manipulation, I've linked your post there for future reference: https://github.com/EsotericSoftware/spine-editor/issues/551

Hi Erika!

Thanks a lot for the confirmation.

The manual workaround would take me too much time for these amount of files, and the 'pixel' workaround would be too error-prone in my case.

So I took the plunge and got to work on the photoshop script, and I've now added a feature that handles a new 'bounds' tags like so:

alternate_item [bounds:original_item]

Which works really well!

If you or Nate would be interested in the feature, let me know and I can send over my version of the script.

15 дней спустя

Sorry this got lost for a bit!

Your feature seems very interesting. Would you like your changes in the official script?

год спустя
Waarten написал

So I took the plunge and got to work on the photoshop script, and I've now added a feature that handles a new 'bounds' tags like so:

alternate_item [bounds:original_item]

Which works really well!

If you or Nate would be interested in the feature, let me know and I can send over my version of the script.

I came to the forum looking for this exact solution! :o
Waarten, are you willing to share your version of the script? Or Nate, could this feature please be added?

Thanks! 🙂

Sure, in the PhotoshopToSpine script v7.26 we've made it use layer mask bounds instead of whitespace trimmed bounds. Unfortunately Photoshop CS2 cannot support layer masks. Docs:
https://github.com/EsotericSoftware/spine-scripts/tree/master/photoshop#layer-masks

Also in v7.28 we added the [mesh] tag. This makes the layer into a mesh attachment, but the cool part is when you use [mesh:name] to name a source mesh, it makes the layer into a linked mesh attachment. It also uses the source mesh size for the linked mesh image, so you don't need to bother with layer masks.

Nate написал

Sure, in the PhotoshopToSpine script v7.26 we've made it use layer mask bounds instead of whitespace trimmed bounds. Unfortunately Photoshop CS2 cannot support layer masks.

Also in v7.28 we added the [mesh] tag. This makes the layer into a mesh attachment, but the cool part is when you use [mesh:name] to name a source mesh, it makes the layer into a linked mesh attachment. It also uses the source mesh size for the linked mesh image, so you don't need to bother with layer masks.

Thanks for pointing that out. I'll give it a try! 🙂