ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

replace single key of multiple

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Andy Engelkemier
replace single key of multiple
on Dec 5, 2019 at 4:07:41 pm
Last Edited By Andy Engelkemier on Dec 5, 2019 at 5:06:53 pm

why do I always figure it out Right after posting!?!

SO I wanted to change one value of the first key, but leave the second value alone.
Documentation is NOT helpful for people who are not already good a programming. It over explains some things, and doesn't explain the part that you need to know. But, that's most help files right?

I didn't understand the syntax for linear()
First, that's hard to search for. And I still don't know what I can do with it.
But here's what worked....

if (numKeys > 1){
t1 = key(1).time;
t2 = key(2).time;
SlideScale = thisComp.layer("AdjAll").effect("MastScale")("Slider");
v1 = [SlideScale, SlideScale]
v2 = key(2).value;

linear(time, t1, t2, v1, v2);
} else {

It's getting the time of when the key is happening in t1 and t2. Then recording the new values for v1 and v2. V2 is just key(2).value because I want it to be the current value unchanged. But since you can't Change a key, you have to write an overly complicated script to basically just recreate all your keys. :/

I would have liked to just change the first key.
Was there an easier way to do this?
Does anyone know where a good explanation of this method exists? I do understand the catch there. If you go to change a key and end up with less than 2 keys, you'll break things, so if that happens it's just defaults back to making no change (else, value)

I just don't understand what other methods I could use in place of time, in "linear(time, t1, t2, v1, v2)"

And what if I have more keys and want to use the first and last, or just be able to define a bunch. Would i have to split these statements into a Bunch of statements after evaluating which keys they are? Because, Wow that would suck.

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 All Rights Reserved