Parameter Bounce
Posted: Mon Dec 03, 2012 16:31
Hello Resolumes,
I would be an optical highlight if it be possible that parameter which are animated via timeline (play ones) can bounce.
Look at the small clip in the attachment. I've made the little physical animation with an AfterFX Script.
Here is the After FX tutorial and the the script so you can try it:
1. Import an image or create a solid layer you want to animate inside a composition.
2. Now first create a null object and rename it to “bouncecontrol”, this will the container
with the expression sliders. Add an Expression controls > Slider Control and in your Effects
panel hit Ctrl+D twice to duplicate it so you got 3 of them. Then rename them accordingly to
“Amplitude”, “Frequency” and “Decay”. These will control how strong, fast and how long the
effect will last.
A good starting point is Amplitude set to 0.2, frequency set to 4 and decay set to 2.
3. Go to the position parameter of your imported image or solid (you can do so by hitting
the “p” key once you selected your layer). Alt click the stopwatch and paste this script :
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){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
amp = thisComp.layer("bouncecontrol").effect("amplitude")("Slider");
freq = thisComp.layer("bouncecontrol").effect("frequency")("Slider");
decay = thisComp.layer("bouncecontrol").effect("decay")("Slider");
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}
I would be an optical highlight if it be possible that parameter which are animated via timeline (play ones) can bounce.
Look at the small clip in the attachment. I've made the little physical animation with an AfterFX Script.
Here is the After FX tutorial and the the script so you can try it:
1. Import an image or create a solid layer you want to animate inside a composition.
2. Now first create a null object and rename it to “bouncecontrol”, this will the container
with the expression sliders. Add an Expression controls > Slider Control and in your Effects
panel hit Ctrl+D twice to duplicate it so you got 3 of them. Then rename them accordingly to
“Amplitude”, “Frequency” and “Decay”. These will control how strong, fast and how long the
effect will last.
A good starting point is Amplitude set to 0.2, frequency set to 4 and decay set to 2.
3. Go to the position parameter of your imported image or solid (you can do so by hitting
the “p” key once you selected your layer). Alt click the stopwatch and paste this script :
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){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
amp = thisComp.layer("bouncecontrol").effect("amplitude")("Slider");
freq = thisComp.layer("bouncecontrol").effect("frequency")("Slider");
decay = thisComp.layer("bouncecontrol").effect("decay")("Slider");
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}