-
Combining Expressions
Hi,
I’ve 600layers from illustrator (like particles).
Have keyframed them individually (argg). – position
Have added an expression to smooth those keyframes with a little bounce.
Have also added a keyframe offset of 10 frames.
Now I want each particle to wiggle as well. How can I add a simple wiggle(2,5)??Thanks in advance
Joao Monteiro// smooth position keyframes bounce //amp = .6;
freq = 2.0;
decay = 2.0;
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}}
if (n == 0){ t = 0;
}else{
t = time - key(n).time;
}
if (n > 0 && t < 1){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value
}// offset frames expression //
maxOffset = 10; // frames
seedRandom(index,true);
offset = framesToTime(random(maxOffset));
valueAtTime(time-offset);