Skip to main content
Participant
February 18, 2014
Answered

Start or Stop expression at a given frame?

  • February 18, 2014
  • 3 replies
  • 69134 views

hello to everyone on the support forum.


I searched the forum but wasn't able to find anything quite good for resolving the matter.

This is something that my IT group Charles Stinson, Nick Carangi, and Sandra Connor have been working on fixing for a while.


I'm getting into expression but the issue is that I am not able to start or stop an expression at a given moment.


I.E. If i want to wiggle(3, 10) until frame 100.

How can I set this up?


Thanks in advance.

After Effects Cs5.5

Correct answer angie_taylor

Add your wiggle

Create a new Null called "Control Layer"

To this add two Expression Control sliders, rename one "frequency" the other "amplitude"

Click on the padlock button in the effects Control panel to keep this visible for the next step

In the expression ass two new lines before wiggle and type;

f=

immediately drag the pickwhip from the expression to the "frequency" effect slider

add a semi colon after this

add a new line and type;

a=

immediately drag the pickwhip from the expression to the "amplitude" effect slider

add a semi colon after this

the next line should be your wiggle and it should read;

wiggle(f,a)

the entire expression should look something like this;

f=thisComp.layer("Controller").effect("frequency")("Slider");

a=thisComp.layer("Controller").effect("amplitude")("Slider");

w=wiggle(f,);

Now you have two sliders to control the frequency and amplitude of your expression

You can animate them to start and stop wherever you like

you can interpolate values or if you want values to suddenly change, Toggle Hold the keyframes

Here's a tutorial that will help you with this;

Setting variable wiggle values

3 replies

angie_taylor
angie_taylorCorrect answer
Legend
April 14, 2018

Add your wiggle

Create a new Null called "Control Layer"

To this add two Expression Control sliders, rename one "frequency" the other "amplitude"

Click on the padlock button in the effects Control panel to keep this visible for the next step

In the expression ass two new lines before wiggle and type;

f=

immediately drag the pickwhip from the expression to the "frequency" effect slider

add a semi colon after this

add a new line and type;

a=

immediately drag the pickwhip from the expression to the "amplitude" effect slider

add a semi colon after this

the next line should be your wiggle and it should read;

wiggle(f,a)

the entire expression should look something like this;

f=thisComp.layer("Controller").effect("frequency")("Slider");

a=thisComp.layer("Controller").effect("amplitude")("Slider");

w=wiggle(f,);

Now you have two sliders to control the frequency and amplitude of your expression

You can animate them to start and stop wherever you like

you can interpolate values or if you want values to suddenly change, Toggle Hold the keyframes

Here's a tutorial that will help you with this;

Setting variable wiggle values

ChiliChili
Participant
December 12, 2018

The best and simpliest solution what I finded. Many thanks, great!

Dan Ebberts
Community Expert
Community Expert
February 18, 2014

If you want it to hold the last wiggle value, I'd do it like this:

stopFrame = 100;

t = Math.min(time,framesToTime(stopFrame));

wiggle(3,10,1,.5,t)

Dan

Mathias Moehl
Community Expert
Community Expert
April 14, 2018

If you are willing to purchase an additional extension, my Expression Timeline is a generic solution to limit expressions to a specific range, fade them in and out and even transition from one expression to another one.

Expression Timeline 2 - aescripts + aeplugins - aescripts.com

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Participant
April 16, 2024

With all those expressions, cluttered timeline, disfunctional graph editor, AE looks sooo medieval... Wothout 3rd party tools it's getting unusable... 

Dave_LaRonde
Inspiring
February 18, 2014

I can think of a way, but it may not be the most efficient way to do it.  I stink at expressions myself.   You can refer the wiggle values to a layer containing sliders.  Using hold keyframes, set the initial values.  At frame 100, change the slider values to turn the wiggle off.

Or just split the layer containing the wiggle at frame 100, and remove the wiggle expression.

Community Expert
February 18, 2014

You could use an if (time < a value) then.... but this gets very unweildly very quickly. As Dave said, the easiest thing to do is to split the layer.

Todd_Kopriva
Inspiring
February 18, 2014

Rick and Dave are correct that it may be easiest to split the layer, but there are examples in After Effects Help for doing this with expressions, here:

http://helpx.adobe.com/en/after-effects/using/expression-examples.html#expression_example_start_or_stop_wiggle_at_specific_time