• Editor
  • How does the [overlay] tag work in PSDs for Spine?

i've recently been switching to PSD imports for my spine projects (its a life saver). however, i don't understand how the [overlay] tag works. the docs say it works as a clipping mask for all underlying layers, but when i view it in Spine it just removes any layers I put under it.
for example i want to have an eye overlay with pupils under them. i'm not a big fan of clipping attachments for handling these

if it helps, i'm using affinity designer 2. everything else exports properly, and when viewing the exported PSD everything looks normal. it also loads into spine just fine

The [overlay] tag in the PhotoshopToSpine script is used to create a clipping mask for all the layers below it. This means that any layer with the [overlay] tag will affect the appearance of the layers beneath it, but only where there are pixels on those layers. If you are experiencing issues where layers are being removed or not displaying as expected, it might be due to how the layers are structured or tagged in your PSD file. Ensure that the [overlay] tag is correctly applied and that the layers you want to be affected are directly beneath the overlay layer. Additionally, check that the layers are not inadvertently hidden or grouped in a way that affects their visibility in Spine.

We should really expand on the documentation for [overlay], as it can be quite useful.

The overlay layer is effectively merged separately on to each layer below it, where those layers have pixels. For example, consider a frog 🐸 character where the skin markings are on an [overlay] layer. The frog's arm would get the markings. The frog's body would also get the markings, even under the arm. It can be useful for shadows, highlights, etc that would be painful if they had to be painted on to multiple overlapping layers.

The inspiration for [overlay] came from Nick in this thread. You can see how it works in his video, starting at 0:26:

That said, if it doesn't work for you please post a PSD showing what you expect to work and we'll take a look!

thanks for the response, it does work for its intended use, i started using it to easily paste some patterns over my character. i still wish there was a tag to make an image work as an active clipping mask in Spine. currently when working with things like eyes i have to split eye outlines on a separate layer above the pupils. For the most part it works, but it isn't perfect.

I don't fully understand your use case. Affinity should have clipping masks, is that not sufficient? But then I'm a programmer and don't spend much time in Photoshop. Our artists can weigh in on Monday!

When working in Photoshop, often "smart objects" are used because Photoshop-specific features (filters, etc) can be used inside a smart object. Spine only sees the merged version of the smart object. I'm not sure if Affinity has something similar or if that would help your use case.

  • Skeir ответили на это сообщение.

    Nate Yes Affinity does have clipping masks. however, Spine doesn't handle clipping masks for use cases like animating a pupil moving inside an eye, without going over the face, or without going over the eye lashes. you can work around this with a clipping attachment, but that requires setting up a mesh and isn't 1:1 to the shape you need depending on the use case.

    another example would be a scrolling texture over a certain part of a weapon. it'd be really easy to pull that off with a clipping mask

    Ah you'd like image-based clipping support in Spine (not an import PSD feature), where the alpha channel of an image is used for clipping, enabling soft edges, etc. It has its challenges, but we've had our eye on that feature for a long time and will eventually get to it!

    Avoiding clipping will always better for performance, when it's possible -- even once we support image-based clipping. One way is to have transparent parts of the head and put the eyes behind the holes. If clipping must be used, use 3-4 vertices and a large triangle if needed. Sometimes that can enable using holes: the hole is still used to provide a soft edge, then clipping can be used (large than the hole) when the eye/whatever would be so large that the head can't cover it. Many times if you find yourself wanting to create many clipping vertices to get a shape you need, it's not the best way.