ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Slider control to adjust a certain keyframe

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Matthew Gia
Slider control to adjust a certain keyframe
on Oct 10, 2017 at 6:46:26 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")


Return to posts index

Brendon Murphy
Re: Slider control to adjust a certain keyframe
on Oct 13, 2017 at 3:53:50 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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]