AE Wiggle
AE wiggle expressions
#code/js
Jumpy Wiggle 1
makes wiggle skip and hold rather than move fluidly.
// Jumpy Wiggle 1 (moves at a random FPS)
v = wiggle(5,50);
(v > 50) ? 10 : 100;
Jumpy Wiggle 2
is similar to 1, but works at a defined FPS so your "jump" will happen at a regular pace.
// Jumpy Wiggle 2 (moves at a defined FPS)
fps = 5; //frequency
amount = 50; //amplitude
wiggle(fps,amount,octaves = 1, amp_mult = 0.5,(Math.round(time*fps))/fps);
Wiggle with Ease
freq = .5; //frequency: fill in or tie to a slider
amp = 30; //amplitude: fill in or tie to a slider
octaves = 1; //default value
amp_mult = 0.5; //default value
period = 1/freq; //time taken for each wiggle move
pCount = Math.floor(time/period); //number of wiggles performed so far
sTime = pCount*period; //time when current wiggle begins
eTime = pCount*period+period; //time when current wiggle ends
p1 = wiggle(freq, amp, octaves, amp_mult, sTime); //start position of current wiggle
p2 = wiggle(freq, amp, octaves, amp_mult, eTime); //end position of current wiggle
ease(time, sTime, eTime, p1, p2); //ease the wiggle
Directional Wiggle
wiggleAngle = 45;
orp = value;
a = degreesToRadians(wiggleAngle-90);
seedRandom(12345);
wigdiff = value - wiggle(2, 100);
wigdir = [wigdiff[0] * Math.cos(a), wigdiff[0] * Math.sin(a)];
orp + wigdir
Directional Wiggle with spread factor
wiggleAngle = 45; spread = 25;
orp = value;
a = degreesToRadians(wiggleAngle-90);
seedRandom(12345);
wigdiff = value - wiggle(2, 100);
wigdir = [wigdiff[0] * Math.cos(a), wigdiff[0] * Math.sin(a)];
wigdelta = (wigdiff - wigdir) * (spread / 100);
orp + wigdelta