Author Topic: Access to layer masks with PSD exporter  (Read 8068 times)

Hi guys,

I've just got my upgrade to 4.4 and I'm very excited to try the psd export option. It seems very useful at first glance.

But I have a problem. I can't work out how to write to a layer mask properly. I have a load of nodes that are overlaid and use masks to blend them in my graph. I want to output all of them to layers with layer masks controlling the opacity of each layer.

I can drag the nodes into the psd exporter as layers just fine, but they always come in with blank white layer masks. I want to bring in the masks from the opacity inputs of my blend nodes and use them as layer masks, but there appears no way to drag onto the layer mask thumbnail. It just replaces the whole layer.

I can add an RGBA merge node and attach the blend input to the A input of that and drag that to a psd layer output, but that's giving me both layer opacity (which I don't want) and a layer mask (which I do). The problem with layer opacity is that the zero opacity pixels aren't recoverable in Photoshop. I want the user to be able to draw white into the mask and reveal the contents of the layer or black to hide it. They can't do that if the layer has opacity as the transparent pixels don't exist. Only if it's fully opaque in terms of layer opacity but masked can they be brought back.

Is there a way around this? At the moment it looks like I'll have to save the masks as hidden layers in the psd and ask the user to set them up as layer masks whenever they output the psd. That's not great. I was hoping it would be possible to automate the layer stack creation.

Thanks

Hi guys,

I've just got my upgrade to 4.4 and I'm very excited to try the psd export option. It seems very useful at first glance.

But I have a problem. I can't work out how to write to a layer mask properly. I have a load of nodes that are overlaid and use masks to blend them in my graph. I want to output all of them to layers with layer masks controlling the opacity of each layer.

I can drag the nodes into the psd exporter as layers just fine, but they always come in with blank white layer masks. I want to bring in the masks from the opacity inputs of my blend nodes and use them as layer masks, but there appears no way to drag onto the layer mask thumbnail. It just replaces the whole layer.

I can add an RGBA merge node and attach the blend input to the A input of that and drag that to a psd layer output, but that's giving me both layer opacity (which I don't want) and a layer mask (which I do). The problem with layer opacity is that the zero opacity pixels aren't recoverable in Photoshop. I want the user to be able to draw white into the mask and reveal the contents of the layer or black to hide it. They can't do that if the layer has opacity as the transparent pixels don't exist. Only if it's fully opaque in terms of layer opacity but masked can they be brought back.

Is there a way around this? At the moment it looks like I'll have to save the masks as hidden layers in the psd and ask the user to set them up as layer masks whenever they output the psd. That's not great. I was hoping it would be possible to automate the layer stack creation.

Thanks

Hi Robin,

I don't think you can set a custom layer mask. The layer mask is the alpha channel of the node added to the layer.

Cheers,

Wes

Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja

Hi Wes,

Thanks for the response.

Yeah that's what I've got, but as you can see in that example, the alpha is written both into the layer mask AND the layer opacity. So if the user opens that psd and tries to fill the layer mask with white, it can't reveal a whole opaque layer because the layer opacity is cutting off the transparent pixels.

Do you see  what I'm getting at? It's the same problem loading a png with transparency into Photoshop and attempting to restore the transparent pixels. You can't, they don't exist.

Thanks

I thought of another way to do this.

In Photoshop you can add a mask to a layer group. That's actually even better for my needs as I expect my users to be wanting to add new layers to each of the layer groups I'm exporting. I thought, well if I can do that in Substance Designer that would fix the problem. I don't need to add layer masks individually.

Unfortunately it doesn't seem to be possible to assign masks to layer groups either. Is that possible? Or am I out of luck either way?

I thought of another way to do this.

In Photoshop you can add a mask to a layer group. That's actually even better for my needs as I expect my users to be wanting to add new layers to each of the layer groups I'm exporting. I thought, well if I can do that in Substance Designer that would fix the problem. I don't need to add layer masks individually.

Unfortunately it doesn't seem to be possible to assign masks to layer groups either. Is that possible? Or am I out of luck either way?

Hi Robin,

Unfortunately, the only masks are added through the transparency in the node. I will log this as a feature request. Thanks for the input!

Cheers,

Wes
Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja

Thanks Wes. I think having full control over what goes into the layer mask and opacity (and most importantly to have the option not use layer opacity) will be a huge improvement.

I thought I'd come up with a workaround by writing a Photoshop action to copy and paste the mask layers into the correct layer masks (if you see what I mean :) but that doesn't work either.

Something to do with the way Designer is saving layers causes layer related actions to not work (possibly the layer opacity and/or layer mask again). I keep getting errors saying things like "the object "layername" is not currently available" and Photoshop can't select the layer. This seems to work on a new document made directly in Photoshop but not on the files I'm exporting from Designer.

Thanks

Hi Wes,

Thanks for the response.

Yeah that's what I've got, but as you can see in that example, the alpha is written both into the layer mask AND the layer opacity. So if the user opens that psd and tries to fill the layer mask with white, it can't reveal a whole opaque layer because the layer opacity is cutting off the transparent pixels.

Do you see  what I'm getting at? It's the same problem loading a png with transparency into Photoshop and attempting to restore the transparent pixels. You can't, they don't exist.

Thanks

I was just going to write a huge post about the PSD exporter, and this one was definitely one of my bigger feature requests.
I couldn't agree more.
It's ok to eventually use a Channel Mixer to read the alpha as a mask, but pixels in the image become transparent too! The layer should be opaque, with the alpha stored in the mask.

I think it would be MUCH better to read the mask from arbitrary grayscale nodes, as yes, the layer could contain transparent pixels, but they don't need to match the mask.

I hope that doesn't sound confusing, but basically it should be like this:

  [LAYER]         [MASK]
       |                  |
 RGBA node     gray node


The layer should be a RGBA node as it may contain transparent pixels, while the mask should just be grayscale node.
Sorry for the ASCII art :)
Last Edit: August 12, 2014, 03:41:23 pm

Hi Wes,

Thanks for the response.

Yeah that's what I've got, but as you can see in that example, the alpha is written both into the layer mask AND the layer opacity. So if the user opens that psd and tries to fill the layer mask with white, it can't reveal a whole opaque layer because the layer opacity is cutting off the transparent pixels.

Do you see  what I'm getting at? It's the same problem loading a png with transparency into Photoshop and attempting to restore the transparent pixels. You can't, they don't exist.

Thanks

I was just going to write a huge post about the PSD exporter, and this one was definitely one of my bigger feature requests.
I couldn't agree more.
It's ok to eventually use a Channel Mixer to read the alpha as a mask, but pixels in the image become transparent too! The layer should be opaque, with the alpha stored in the mask.

I think it would be MUCH better to read the mask from arbitrary grayscale nodes, as yes, the layer could contain transparent pixels, but they don't need to match the mask.

I hope that doesn't sound confusing, but basically it should be like this:

  [LAYER]         [MASK]
       |                  |
 RGBA node     gray node


The layer should be a RGBA node as it may contain transparent pixels, while the mask should just be grayscale node.
Sorry for the ASCII art :)

Thanks for the feedback! I've logged this in our system.

Cheers,

Wes
Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja

Thank you Wes!
I've added my list of Feature Requests for the psd exporter here

Cheers!

Thank you Wes!
I've added my list of Feature Requests for the psd exporter here

Cheers!

That is great! Thanks very much. I will update the ticket in our system to include your post.

Cheers,

Wes
Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja

Any news on if this is likely to be updated soon? I have over 500 maps to export and currently I'll have to go over each one by hand copying half a dozen masks from layers into layer group masks in Photoshop. I'd rather not have to do that by hand. Especially as I'll have to do it again every time I update a map. :(

Thanks

Edit: Not 200, more like 500. I forgot I have 2 psds to export for each object and some of those are broken into 2 maps.
Last Edit: September 16, 2014, 02:18:07 pm

As far as I can see from the promo materials for 4.5 this is still a problem. Is that the case? I won't try and update if it is.

Yes, we have not addressed this yet.

OK thanks for the confirmation Cyrille. We're working on a Photoshop action or script to do it. We found a bug with layer names that stops actions working on psds exported from Designer, but we have a script to reset them.

Yes, I read that (thanks for reporting it) and entered it in our bug tracker database. I can't give you an ETA for all that as we are currently very busy solving the crashing bugs introduced by 4.5.0.