Script to batch create layer masks from cut-outs

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

pixeldeluxe

Script to batch create layer masks from cut-outs

Post by pixeldeluxe »

Hi. As a newby I have the following little task: I am working on automative cgi imagery want to automate some of the basic work. We basicly render highRes exr's for all the lights and every major material as cut-out saved as png. The task is to batch load the png's in one file as layers, name the layers as the original file name(as by the existing photoshop script - so tha's the easy part…..) Now load a selection of each layer (cut-outs on transparent background), make a new group add the selection as layer mask to the new group and rename it. So if a I have 4 different layers, I will get 4 groups with indivitual layer masks. For example all the black plastic gets a group (based on a render of only the black plastic on transparent background), or the chrome parts. So in the end we get a bunch of empty groups, each masked for a special material.
We need that for all the colour corrections and adjustments.
Any ideas? If needed I can try to explain it a it better but as english is not my mother tongue it may be a bit tricky.

Thanx in advance for any help.

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

pfaffenbichler

Script to batch create layer masks from cut-outs

Post by pfaffenbichler »

Just record the various steps ()loading a Layer’s transparency, applying a Selection as a Layer Mask …) with ScriptingListener.plugin and combine those sequences (wrapped in functions) with the DOM code for what the DOM can handle (like getting the active Layer’s name, creating and renaming a LayerSet …).
pixeldeluxe

Script to batch create layer masks from cut-outs

Post by pixeldeluxe »

thanx for that. will try that. sounds kind of easy even for me. will keep you informed if i come right.