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.
Copy link to clipboard
Copied
I don't think I've seen that in the scripting docs. Where did you see it?
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?
Copy link to clipboard
Copied
I'm not aware of any way to control Preserve RGB via scripting.
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):
I haven't tested this out myself but I can imagine it'll work.
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.
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...
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.
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", *
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?
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.
Copy link to clipboard
Copied
I see. I'll look into it. 🙂