Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Slider control to adjust a certain keyframe

  • Slider control to adjust a certain keyframe

    Posted by Matthew Gia on October 10, 2017 at 6:46 pm

    Hello, I’ve recently started doing some research on how to use expressions in After Effects (cs6) and im still fairly clueless on how to operate them so I was hoping somebody could help me out. Im using trapcode form for my project and I want to use a slider controller to adjust the values of a particular key frame (2nd keyframe to be specific, this keyframe is important as it adjusts the strength of the particles). Whenever I parent the strength layer to the slider controller it adjusts for all the keyframes, but I want it to only focus on one, thank you.

    *If anyone has a link to a tutorial to this situation can you please send it to me, thank you.

    Code for trapcode form (NOT LINKED TO ANYTHING)
    effect("Form")(126)

    When it's linked:
    thisComp.layer("Control").effect("Slider Control")("Slider")

    Brendon Murphy replied 8 years, 7 months ago 2 Members · 1 Reply
  • 1 Reply
  • Brendon Murphy

    October 13, 2017 at 3:53 pm

    Matthew,

    I’m not sure which parameter you are using to control the strength, but you could try one of the following:

    -Keyframe the slider so it goes from 0 to your desired amount on the correct frame, and then back to 0.

    OR

    -Add the below expression to the parameter – it makes the slider affect only the second keyframe. You’ll need to change “Strength Slider” in the first line to the name of your slider (I’m assuming the slider is on the same layer as your Form effect). The strengthKey value can also be changed to whichever keyframe you want to affect.

    strengthControl = effect("Strength Slider")("Slider");
    strengthKey = 2

    n = 0;
    if (numKeys > 0) {
    n = nearestKey(time).index;
    if (key(n).time > time) n--;
    };

    if(n==strengthKey){
    value+strengthControl} else value;

    Brendon Murphy
    ________________
    Visual Effects
    http://www.brendonmurphy.net

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