• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to Script copy+paste a grayscale layer into Channel with Scripting?

New Here ,
Mar 22, 2021 Mar 22, 2021

Copy link to clipboard

Copied

Trying to automate channel packing for Unity 3D in photoshop wtih scripting .jsx, but I have no idea how to:

1. Take a non-visible grayscale layer and paste it directly into the Red channel.

2. Take another non-visible grayscale layer and do that same thing with the Green channel.

3. Take another non-visible grayscale layer and paste it into a new mask on the active (visible) layer.

 

I've figured out how to save out and other things just fine, I just can't figure out how to modify channel data (seems from the documentation it's readonly?).

 

Thanks!

TOPICS
Actions and scripting

Views

909

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Mar 23, 2021 Mar 23, 2021

Copy link to clipboard

Copied

The forum needs to understand the file and layer structure.

 

Is the source a separate file? Is the destination a separate file?

 

Or a single file?

 

How many files may be open at a singe time? Will you be working on other projects at the same time, or will only the required files be open for this task?

 

What colour mode are the source and destination docs? Grayscale or RGB? If the source layers are "grey" then can we presume that the RGB channels are exaxtly the same for the sourxe file (R=G=B)?

 

You don't mention the B channel.

 

Can you show cropped screenshots of the layers panel for the source and destination files, as well as the channels panel for both files? Can you provide sample files?

 

Will channels always have the same names? What about the layers? What about source and destination file names?

 

You know the files and workflow, others don't.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 23, 2021 Mar 23, 2021

Copy link to clipboard

Copied

Please explain the process more clearly, ideally post the images or at least meaningful screenshots including the pertinent Panels. 

 

An RGB image can obviously not contain a grayscale Layer so how many files are you talking about? 

How can the corresponfing files be identified – is there a naming convention? 

 

Edit: Should have refreshed the page before posting … 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 23, 2021 Mar 23, 2021

Copy link to clipboard

Copied

LATEST

Haha, great minds...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines