Nick

Sometimes we have layers that are NOT adjustment layer but normal layer with different blend mode casting across different parts of the composition. e.g. light, shadow, color layer on the whole scene/character etc.

With current export script, we can only manually crop and apply those layers to each affected sprites. Usually put them inside a [merge] group so that the export would have the effects merged on the final sprites.

The suggestion here is to have a [adjust] tag that treat these layers like adjustment layer. These layers will auto apply to everything down below. One extra thing need to care about this is that these layers need to have clipping mask enabled to the actually pixels of the export because they are not real adjustment layer but normal layer which will affect the export dimension of the original sprite when not clipped correctly.

Example:

-- [adjust] Sunlight (kind of glow layer)
----[merge] Tree A
----[merge] Tree B

In this case, the Sunlight layer need to have clipping mask on Tree A when Tree A is exporting and so on for other sprites.

Just an idea to make some export scenarios easier.

P.S.
Maybe you would ask why not have the that layer be an a standalone sprite over the parts.
There are some reasons.
1. It could be using the blend mode that is not supported. ( saturation, color layer, etc)
2. It could be large and not needed to be alone. Merging them save texture space significantly.
Nick
  • Posts: 292

Erika

Hello Nick, it sounds like you want clipping masks to be detected and applied correctly rather than add necessarily a new tag.
This is a good suggestion, I wrote down my thoughts about it in the issue here: Photoshop To Spine script to consider clipping masks · #559 · EsotericSoftware/spine-editor
Please let me know if it corresponds to your vision or if you have anything else to add!
User avatar
Erika

Erikari
  • Posts: 3051

Nick

Hello Nick, it sounds like you want clipping masks to be detected and applied correctly rather than add necessarily a new tag.
Nope, those adjustment layers will not have "clipping mask" enabled because they are just normal non adjustment layer on top of many layers. A tag is needed to identify them and treat them like real adjustment layer (with clipping to preserve export shape).

You can imagine an example of a scene with is a day light forest but later have a few layers added on top of everything that change the whole scene to night version. Those newly added layers do not clipped from below but just placed over many original layers as normal layers.

Lets take the 1st sample to elaborate more. When exporting Tree B, the Sunlight layer is not clipped on it direct but just a normal layer far away from it. However, since it has [adjust] tag with it, we will treat it like adjustment layer and cast it to Tree B (an everything else during the export).
-- [adjust] Sunlight
----[merge] Tree A
----...(there could be many things in between)...
----[merge] Tree B
The filtered export tree became (when exporting Tree B):
-- [adjust] Sunlight
----[merge] Tree B
Note that we cannot just export this as Tree B.png because the Sunlight layer is much larger than Tree B.
To preserve the shape of Tree B, we need to clip Sunlight to be within Tree B's shape. Thus, the clipping mask is toggled for [adjust] layer.
-- Sunlight (clipped to pixels below)
----Tree B
Nick
  • Posts: 292

Erika

Could you post an example PSD for our team to use as reference?
User avatar
Erika

Erikari
  • Posts: 3051

Nick

It takes a little time to prepare and finally here is a sample scene PSD for testing the situation I mentioned.

https://drive.google.com/file/d/1av1YheUutRhUuQwEcfK3u29a6NagdGKv/view?usp=sharing

I created a folder "Adjustments" to hold those mentioned adjusting layers ( already tagged with [adjust] ).

For testing purpose, I already merged a lot of things from this draft to keep things simple. Every standalone layers you see need to be standalone for animation purpose or for z-order purpose (character could walk behind them).

The expected result of the export will be having those [adjust] layers applied to every standalone layers below but keeping the original shape instead of being affected by [adjust] layers. Thus a little logic is needed to smartly toggle clipping mask to the sprite pixels as mentioned in previous discussion.

Thanks. :nerd:
Nick
  • Posts: 292


Return to Editor