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?
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
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);
Copy link to clipboard
Copied
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