Expressions/Scripts/Presets

Moderator: Paul Tuersley

 
greenlimejuice
Topic Author
Posts: 2
Joined: Thu Jul 27, 2017 5:07 pm

setValue() to levels effect not returning expected value

Thu Jul 27, 2017 5:17 pm

I'm trying to add a levels effect to a composition and set the value for "Input Black" and "Input White"

However, when I run the script in After effects I see values thousand above what I put in. 

Here is my code:
myComp.property("Effects").property("Levels").property("Input Black").setValue(118);
myComp.property("Effects").property("Levels").property("Input White").setValue(141);

The value I get in After Effects are:
Input Black = 30090
Input White = 35955

On my last line of my code, I even added an alert to tell me the value of input white and it said it was 141 so I know nothing later in the code is changing it. 

What am I not understanding? 
 
greenlimejuice
Topic Author
Posts: 2
Joined: Thu Jul 27, 2017 5:07 pm

Re: setValue() to levels effect not returning expected value

Fri Jul 28, 2017 11:52 am

Dan Ebberts answered my question on creative cow. 
"Colors need to be normalized to be between zero and one. So this should work to get 141:

myComp.property("Effects").property("Levels").property("Input White").setValue(141/255);"

Who is online

Users browsing this forum: No registered users and 4 guests