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

Turn "preserveRGB" on on a footage item using extendscript

Participant ,
Apr 04, 2023 Apr 04, 2023

Copy link to clipboard

Copied

I tried various things, but I didn't succeed to turn on "preserveRGB" on on a footage item using extendscript.

The following script doesn't work. It suppose to set PreserveRGB on on the selected footage item.

 

 

app.project.activeItem.mainSource.colorProfile.preserveRGB = true;

 

 

colorProfile always seems to be undefined, but the documentation state...

ColorProfile.preserveRGB
Description: A boolean value indicating whether the RGB values are preserved or not.
Type: bool
Access: Read/write.
TOPICS
How to , Scripting

Views

600

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 ,
Apr 04, 2023 Apr 04, 2023

Copy link to clipboard

Copied

I don't think I've seen that in the scripting docs. Where did you see it?

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
Participant ,
Apr 05, 2023 Apr 05, 2023

Copy link to clipboard

Copied

ChatGTP claimed to found it in the after effects scripting documentation, but now when asked where exactly "I apologize for the confusion. I have reviewed the After Effects scripting documentation again, and I cannot find any mention of a preserveRGB property for the ColorProfile object. It's possible that I made an error in my previous responses." So strange where it did come up with it before...? So I gues this setting cannot be set by extendscript? Also not with scriptlistener code?

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 ,
Apr 05, 2023 Apr 05, 2023

Copy link to clipboard

Copied

I'm not aware of any way to control Preserve RGB via scripting.

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
Participant ,
Apr 21, 2023 Apr 21, 2023

Copy link to clipboard

Copied

I guess you could use a somewhat complicated workaround to set "Preserve RGB" (but it's probably more of an advanced scripting challenge):

 

  1. Create a dummy footage
  2. Import the dummy footage item into an empty project
  3. Set the footage to "Preserve RGB"
  4. Save the project
  5. Create a binary of the project so you can include it in your script
  6. Within the script, import the project
  7. Select the project panel by hiding, then showing the project panel: app.project.showWindow(false);  app.project.showWindow(true)
  8. Select the dummy footage
  9. Execute "Remember Interpretation" by using app.executeCommand()
  10. Now deselect the dummy footage and select the footage where you want to set "Preserve RGB"
  11. Execute "Apply Interpretation" by using app.executeCommand()
  12. Delete the previously imported footage

 

I haven't tested this out myself but I can imagine it'll work.

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
Participant ,
Apr 24, 2023 Apr 24, 2023

Copy link to clipboard

Copied

Interesting approach! I may try this somewhere in the future, but I get your strategy. It's strange why these options are not included in the API by default in the first place. I have seen people ask about the scripting possibilities for "Preserve RGB" going back years.

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
Participant ,
Apr 24, 2023 Apr 24, 2023

Copy link to clipboard

Copied

Yeah, seems to be quite an essential thing that should be included in the API. You could write a featue request in the hopes that they'll implement it...

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
Participant ,
Dec 23, 2023 Dec 23, 2023

Copy link to clipboard

Copied

It's crazy that you can't access this via scripting. What you can do is edit the Interpretation Rules.txt to set a file type (like EXRs) to always import Preserve RGB.

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
Participant ,
Dec 23, 2023 Dec 23, 2023

Copy link to clipboard

Copied

Automatically Import OpenEXR with Preserve RGB checked:

You can automatically set EXR files to always import with "Preserve RGB" on.

- Navigate to your Preferences:
for example C:\Users\Eric\AppData\Roaming\Adobe\After Effects\23.4
- Open "Interpretation Rules.txt"
- Find "OpenEXR"
- Change the line below it to:

*, *, *, "oEXR", * = *, *, *, P, "pRGB", *

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
Participant ,
Dec 23, 2023 Dec 23, 2023

Copy link to clipboard

Copied

Now that's really interesting. Is it possible to set this to a certain color space too using this method? Also, can you do it with all other formats?

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
Participant ,
Dec 23, 2023 Dec 23, 2023

Copy link to clipboard

Copied

You can do it with other formats.

 

I didn't look into the color space part, as we handle color management with OCIO & LUTs on adjustment layers.

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
Participant ,
Dec 23, 2023 Dec 23, 2023

Copy link to clipboard

Copied

LATEST

I see. I'll look into it. 🙂

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