ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# Wiggle frequency based on velocity

FAQ   •   VIEW ALL
 Wiggle frequency based on velocity on Jan 18, 2018 at 3:20:41 am

Love Dan Ebbert's explanation for why wiggle and sine expressions go weird when you keyframe them:
http://www.motionscript.com/articles/speed-control.html

However, his solution (the linear keyframe integrator) seems to only work when the frequency is manually keyframed.

I'm looking to affect frequency automatically based on the layer's speed, specifically, a "head bob" that bobs more frequently as the camera moves faster. FWIW, the camera's position will be manually keyframed.

Obviously I would want the frequency to ramp up/down smoothly.

Any solutions to this? Thanks!

Arvin Bautista
Greasy Pig Studios
Los Angeles, CA
http://www.greasypigstudios.com

 Re: Wiggle frequency based on velocityon Jan 18, 2018 at 7:14:23 am

I think you'll need to combine a couple of techniques. You can use the frame-by-frame integrator (http://www.motionscript.com/articles/speed-control.html#frame-by-frame) to integrate the camera's speed, using position.speedAtTime(), and then apply some multiple of that total as the time parameter to your wiggle. Should be straightforward (although slow), but I haven't tried it.

Dan

 Re: Wiggle frequency based on velocityon Jan 20, 2018 at 2:21:58 am

I think I got it to work, but as you warned in your article, it's just way too slow to do it using the frame by frame integrator. I'm just going to take the camera's speed value and convert it to keyframes, and use the linear integrator on that. The camera velocity doesn't jump around so much that I can run a smoother to reduce the number of keyframes if I wanted, and the wiggle doesn't have to be 100% accurate, that this is a good enough solution.

Thanks!

Next question: is there a way to get an object's rotation "velocity"? I wanted to link the camera's Z rotation to the velocity of its Y rotation, in order to simulate a banking/head tilt when the camera turns its head. I'd need it to rotate left or right depending on which way the camera is turning, obviously.

Arvin Bautista
Greasy Pig Studios
Los Angeles, CA
http://www.greasypigstudios.com