Skip to main content
Participating Frequently
February 4, 2020
Answered

Automate masking

  • February 4, 2020
  • 3 replies
  • 2495 views

Hi, I have a specific question.
I need to compositing separate images. Every layers have a unique folder and a mask layer. All  the layers have the same name BPR_Render and BPR_Mask but different folder. I need to copy the mask from BPR_Mask layer to the folder. After this action I delete the BPR_Mask layer. I get as result only the BPR_Render at the uniqually named and masked folder.
I need to do this process with every folder.
I would like to automatize this process. But Action is not suited for this because I can't make a relative refferencing in actions.
How can I autamate this process? I would be very happy if someone could help me this problem.

This topic has been closed for replies.
Correct answer JJMack

Okay. I try again.
I have rendered pictures. A diffuse and a mask separately.

Because it is the same size and position I don't need to do anything with positioning and sizing.
A put this files to separate folders. This is a Body folder for example.

I would like to add the mask to the folder as a proper compositing software do, like Nuke.So the layer has the mask or alpha. 

I would like a solution to add the alpha render to the corresponding layer. Beacus if I made an action from that what I do manually, that will find the name of the folder. The same nam like body. But i have a folder named as head, legs etc. I can't made it to the "currently active folder" wiht photshop actions as far as I know.


You want to put images into some document where did that document get into your work-flow. Is it a new document created the withe a canvas size size to house you the two image files your are going to put in the document.  How will they be positioned for the document composition they would most like need to have the same size canvas so the would align correctly. If you want to put image files in how will the process put the correct image file in. Action step settings are recorded in the action steps in you action, File names are recorded into in the step. The step will always address the same file.  Or save a file for the current document with  and default the file name to the current document name.  If you want to process files in a folder  or folders you need to use Automate Batch or an image processor script.  These Batch Processor Open files in photoshop an play your Batch actions process one file at at time not on file pairs. Or you need to Programs A Photoshop script which you do not know how to do. A script can process pairs if files.  To do a Batch Automate you need to automate the all the processing that need to be done.  I do not understand why you created two image file to begin with where the second image is a black and white or gray scale image the you want to turn into a layer mask for the first image you created why did you not simply mask the first image you created instead of creating a second image file. why are you crating a layer group and masking it when there will be only a single layer in the layer group like your screen capture shows.  Perhaps if you describe what you are trying to automate better someone can help you design a work-flow process the can be automated with a batch action.  Batch actions normal process a single document at a time they may add the same file into each document in the process process.  Batch action can not add files with different names for  the current document relative to the document name or layer names. Action can only test a few document and layer conditions Action conditional steps.  The kind of logic you want to use in your processing would require Photoshop scripting.

3 replies

Stephen Marsh
Community Expert
Community Expert
February 4, 2020

This looks like it can be automated, perhaps with an action+helper-script or with a full script.

 

It would be good if you can provide a download link to say 3 PSD files with layers and layer sets exactly the same as used in your project. These can be reduced in size/resolution as it is not so much about the quality of the image, but working with the layer structure and looking for consistency etc.

Participating Frequently
February 5, 2020

Thank you very much your answer. Sadly I can't provide this files. We have wery strict rules in the company about what kind of source materials we can giv out from Gameloft. I will ask a tech artist here to program this script.  Now I tried to investigate the posibilities. I hoped we can solve this problem with an action inside Photshop. Now Is clear a simple artist without scripting knowledge is not possible.

Stephen Marsh
Community Expert
Community Expert
February 6, 2020

Screenshots would do, in a pinch, it is not that I don't trust you, however from previous experience, oftentimes the examples posted on the forum don't match the real files and a whole lot of time is wasted by those helping as they write a custom solution for a poorly advertised problem.

JJMack
Community Expert
Community Expert
February 4, 2020

I do not believe you will be able to automate Photoshop 3D rendering and masking in a batch Action or script.  3D layer are not like Smart Object layer where you can replace the smart object layer'e object content.   You can not replace 3D layers meshes. I have never see a Mockup template that use 3D layers that get replaced to update the mockup with a different design. Scripts can use logic to reference things relatively but I don't know how you would be able to automate 3D Layer rendering and masking changing lighting.

JJMack
Participating Frequently
February 4, 2020

No that is a totaly simple 2D layers. Just I wrote the exact name like BPR_Render. So I think you missunderstand me. I'm sorry about that. I should explain more this simple problem. I already have rendered pictures, a diffuse render and a mask. Have a head a jaw a body etc. I just would like to put this fils to layers. I just would like to add a mask to the folder, and repeate this action. Becaus I need to do it manually with a lots of files. That is why I would like to find an automated process for this small action. 

c.pfaffenbichler
Community Expert
Community Expert
February 4, 2020

_

c.pfaffenbichler
Community Expert
Community Expert
February 4, 2020

Please clarify the Layer set-up with a screenshot. 

And what is the »mask layer« supposed to be exactly? If the file is RGB and this is a neutral Layer would you need to use the composite or one of the three RGB-Channels as a Layer Mask? 

 

Very probably this can be automated with a Script; are you familiar with JabaScript? 

Participating Frequently
February 4, 2020

I belive so script would be help this. Hovewer I'm not familiar at all with javascripting sadly. 
The first picture show what I have. The second is what I just would like to aquire. I apologize for the misunderstanding. I should attach a picture what I would like to achive. 

c.pfaffenbichler
Community Expert
Community Expert
February 5, 2020

I don’t think you answered this question yet: 

Would you need to use the composite or one of the three RGB-Channels as a Layer Mask?