Copy keyframe value from "Levels" effect "Histogram" property with Extendscript

Explorer ,
Feb 11, 2022 Feb 11, 2022

Copy link to clipboard

Copied

Hello;

 

I'm working on a portion of a script that shifts all properties keyframes in time and remap them to a certain duration.

I have layer that have the "Levels" effect animated. When the script reaches the "Histogram", animated property of the Levels effect.

The script works perfectly for other layers and all properties, except for the Levels effect and it's animated property.

It gets stuck, and stops the execution when I try to copy the keyframe value of the Levels effect with this command.

curKeyValue = propertyInput.keyValue(i);

 

So I'm wondering, how can I copy the value of this property via Extend Script.

Is there any other command or work around to copy the value of such property.

 

Thank you so much for reading this post.

I really appreciate your help.

TOPICS
Error or problem , Expressions , Scripting

Views

44

Likes

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

correct answers 1 Correct answer

Enthusiast , Feb 11, 2022 Feb 11, 2022
Scripts can't read/write the values of custom data types. You can check for them by checking the property.propertyValueType:if (property.propertyValueType == PropertyValueType.CUSTOM_VALUE)https://ae-scripting.docsforadobe.dev/properties/property.html#property-propertyvaluetype I realise this messes up your idea for this script. I guess you'll have to either accept it won't work for all keyframes or find a different approach. 

Likes

Translate

Translate
Enthusiast ,
Feb 11, 2022 Feb 11, 2022

Copy link to clipboard

Copied

Scripts can't read/write the values of custom data types. You can check for them by checking the property.propertyValueType:

if (property.propertyValueType == PropertyValueType.CUSTOM_VALUE)
 
I realise this messes up your idea for this script. I guess you'll have to either accept it won't work for all keyframes or find a different approach.
 

Likes

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
Explorer ,
Feb 11, 2022 Feb 11, 2022

Copy link to clipboard

Copied

LATEST

Thank you for your help.

I didn't really think that scripts has such limitations.

I thought at first, that you can do anything with scripts.

I guess, I have to find another approach.

 

Likes

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