• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Stop wiggle at certain time and keep value

New Here ,
Sep 26, 2016 Sep 26, 2016

Copy link to clipboard

Copied

I'm trying to create an animation whose length can be user-controlled via a slider.

It is about a layer which rotates in 3D space and it works just fine for the rotation and length controls.

But I want to give that layer also some random movement in the form of a wiggle on the position property. I figured out how to stop the wiggle at a certain point in time, but after that point it just jumps back to its initial value. But I want it to keep it the value it has on the last frame the wiggle is active.

Is there a way to do this?

TOPICS
Expressions

Views

3.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Sep 26, 2016 Sep 26, 2016

You can also use the time parameter of the wiggle.

Given that time is in 5th position in the arguments, you also need to specify the 3rd and 4th (octaves=1 and amp_mult=0.5 are the defaults):

holdTime = effect("Slider Control")("Slider");

wiggle(0.5, 50, octaves = 1, amp_mult = .5, t = Math.min(time, holdTime));

Xavier

Votes

Translate

Translate
Enthusiast ,
Sep 26, 2016 Sep 26, 2016

Copy link to clipboard

Copied

One way to do this is to do the wiggle on something like an Expression Controls > Point Control effect then access it using valueAtTime. Here's an example you'd put on Position where you've added a Point Control (set to 0,0) to the layer with a wiggle and a Slider Control to set the time the wiggle should stop. If you want to wiggle in 3D you could always use a 3D null to hold the initial wiggle.

holdTime = effect("Slider Control")("Slider");

wig = effect("Point Control")("Point");

if (time < holdTime) value + wig;

else value + wig.valueAtTime(holdTime);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Sep 26, 2016 Sep 26, 2016

Copy link to clipboard

Copied

LATEST

You can also use the time parameter of the wiggle.

Given that time is in 5th position in the arguments, you also need to specify the 3rd and 4th (octaves=1 and amp_mult=0.5 are the defaults):

holdTime = effect("Slider Control")("Slider");

wiggle(0.5, 50, octaves = 1, amp_mult = .5, t = Math.min(time, holdTime));

Xavier

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines