Author Topic: Write Masks to Alpha Channel  (Read 6895 times)

2020-02-21, 10:04:33
Reply #15

Frood

  • Active Users
  • **
  • Posts: 2002
    • View Profile
    • Rakete GmbH
Welcome. But I want to understand: why you recorded some action? What for? It should work like this: select some layers, use "Layers to Channels" and that's it(?).


Good Luck



Never underestimate the power of a well placed level one spell.

2020-02-21, 12:15:36
Reply #16

cjwidd

  • Active Users
  • **
  • Posts: 1077
    • View Profile
    • Artstation
This was my reason for asking - I misunderstood the instructions for using the script, having not looked at the code.

My mistake.

Yes, the script will process all selected layers; it is not necessary to run the script on each layer individually.

2020-02-21, 12:34:56
Reply #17

Frood

  • Active Users
  • **
  • Posts: 2002
    • View Profile
    • Rakete GmbH
Ah, ok. Well, a short description what it does can be found in Photoshop Help-> About Plugins -> Layer to Channels or in the Script Events Manager when selecting it:

"Creates channels from selected layers (e.g. render masks) and removes them. Creates separate channels for R/G/B if they are not equal."

Oops, just corrected a typo and replaced the zip. So have fun and

Good Luck






Never underestimate the power of a well placed level one spell.

2020-02-21, 19:08:12
Reply #18

GeorgeK

  • Corona Team
  • Active Users
  • ****
  • Posts: 838
  • George
    • View Profile
@Frood

Your script is fantastic and it so happens that it is exactly what I was trying to achieve. Thank you so much for sharing, I really, really appreciate it :)

In your case, you are loading packed RGB masks - not mono masks - into the layered .EXR and then running the script on a single layer, i.e. the script does not loop through all layers, only the selected layer?

@GeorgeK

The Random Wire Color Tools script is really great for its intended use case, i.e. assigning wire colors to objects in the scene. How are you using it in conjunction with masking in your workflow? For example, are you using packed RGB masks or mono masks? In the case of the former, obviously you can use CMasking_WireColor, but this produces a single RGB mask that would have to be color selected in PS, which may require additional clean-up to generate a clean mask.

There is another script on the forums (2015) that will generate mono masks based on ALL scene materials, which when used in conjunction with @Frood's script, basically implements the workflow I had imagined. However, unless you keep a VERY tidy scene you are going to generate a bunch of masks you don't need (i.e. materials that are on hidden objects, HDRIs, rayswitch, etc.).

I'm looking through the script (.ms) now to see if there is a way to condition the mask generation loop on only selected objects or based on wire color instead of material.

Just mono! Haven't used multi channel alpha since my game-dev times, were we would put normal alpha and emission on those channels for .dds, but we had coders to hardcode the loading in the game engine.

I will try what frood provided looks amazing, and it's a pretty nice workflow for cases with many element outputs.
George Karampelas | chaos-corona.com
Chaos Corona QA Specialist | contact us