Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions replace single key of multiple

  • replace single key of multiple

    Posted by Andy Engelkemier on December 5, 2019 at 4:07 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 {
    value
    }

    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.

    Andy Engelkemier replied 6 years, 5 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy