FORUMS: list search recent posts

Per Character Bounce Scale

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Sal Joseph
Per Character Bounce Scale
on Mar 23, 2011 at 8:05:27 pm

I've seen this effect recently on a tv commercial.
It's similar to the effect you would create by adding a text animator for Scale, Based on Character, Randomize Order ON, and keyframing the range start from 0-100%.
Only each character had a Spring/Bounce to it.

Essentially, it's THIS effect put on each character of a word, scaling in random order:

freq =3;
amplitude = -100;
decay = 1.0;

s = amplitude*Math.cos(freq*time*2*Math.PI)/Math.exp(decay*time);
scale + [s,s]


I'm assuming there's a way to do this without having the expression on a layer for each character (otherwise I applaud that animator's patience).

I tried combining expressions with a Text animator. But maybe that's the wrong approach.


Return to posts index

Dan Ebberts
Re: Per Character Bounce Scale
on Mar 23, 2011 at 10:14:16 pm

Play with this:

Add a Scale Animator, set the Scale value to 0. And an Expression Selector, delete the Range Selector, and add this expression to the Expression Selector's Amount parameter:


maxDelay = 2;
seedRandom(textIndex,true);
myDelay = random(maxDelay);
t = time - myDelay;
if (t >= 0){
freq =3;
amplitude = -100;
decay = 1.0;
s = amplitude*Math.cos(freq*t*2*Math.PI)/Math.exp(decay*t);
[s,s]
}else{
value
}



Dan



Return to posts index

Sal Joseph
Re: Per Character Bounce Scale
on Mar 23, 2011 at 11:45:06 pm

Incredible. Works perfectly.
Thank you again!


Return to posts index


Sal Joseph
Re: Per Character Bounce Scale
on Mar 24, 2011 at 12:03:33 am

Also, just noticing that an amplitude of +100 makes the characters grow from 0, whereas an amplitude of -100 causes them to pop on.


Return to posts index

S.J. DeLuise
Re: Per Character Bounce Scale
on Jul 12, 2011 at 3:55:07 pm

Could this expression selector be applied to other expressions? For instance if I wanted the characters (or words) to bounce in one at a time using the bounce expression seen below. Is it a simple matter of switching the 'if' condition to that bounce expression?

I tried but I think I'm missing something, maybe on another parameter.

//BOUNCE EXPRESSION
freq = 1.0; //oscillations per second
amplitude = 90;
decay = .5;

posCos = Math.abs(Math.cos(freq*time*2*Math.PI));
y = amplitude*posCos/Math.exp(decay*time);
position - [0,y]

//MODIFIED EXPRESSION SELECTOR
maxDelay = 2;
seedRandom(textIndex,true);
myDelay = random(maxDelay);
t = time - myDelay;
if (t >= 0){

freq = 1.0; //oscillations per second
amplitude = 90;
decay = .5;
posCos = Math.abs(Math.cos(freq*t*2*Math.PI));
y = amplitude*posCos/Math.exp(decay*t);
position - [0,y]

} else {
value
}


People say my motion graphics are moving.


Return to posts index

Dan Ebberts
Re: Per Character Bounce Scale
on Jul 12, 2011 at 5:00:55 pm

Set the y component of your Position animator to the maximum value you want. Then try this in the Expression Selector:


maxDelay = 2;
seedRandom(textIndex,true);
myDelay = random(maxDelay);
t = time - myDelay;
if (t >= 0){
freq = 1.0; //oscillations per second
amplitude = 100;
decay = .5;
posCos = Math.abs(Math.cos(freq*t*2*Math.PI));
amplitude*posCos/Math.exp(decay*t);
} else {
value
}


Dan



Return to posts index


S.J. DeLuise
Re: Per Character Bounce Scale
on Jul 12, 2011 at 5:11:19 pm

Works great!
Is there any way to do this by word rather than by character?

Very cool. Sure beats having a layer for every letter.
Would this work for Y-rotations per letter, like a Wheel of Fortune reveal, etc.?

People say my motion graphics are moving.


Return to posts index

Dan Ebberts
Re: Per Character Bounce Scale
on Jul 12, 2011 at 5:27:56 pm

In the Expression Selector, just change Based On to "Words".

>Would this work for Y-rotations per letter?

Yes.

Dan



Return to posts index

S.J. DeLuise
Re: Per Character Bounce Scale
on Jul 12, 2011 at 5:49:04 pm

Ah, yes. That parameter was temporarily hidden for me.
So many possibilities. Thank again, Dan.
Your code is simple amazing - kudos.

People say my motion graphics are moving.


Return to posts index


S.J. DeLuise
Re: Per Character Bounce Scale
on Jul 13, 2011 at 1:40:51 am

Examples from playing around with these awesomely nifty codes:


People say my motion graphics are moving.


Return to posts index

Charlie Aquino
Re: Per Character Bounce Scale
on Aug 18, 2011 at 9:44:01 am

Thanks a lot for this. It helped a lot.

But just a question. What if you don't want the animation to be random, how do we modify the expression?

Thanks a lot!


Return to posts index

Dan Ebberts
Re: Per Character Bounce Scale
on Aug 18, 2011 at 1:52:23 pm

Did you just want a delay that increases for each character? That would look like this:


delay = .1;
myDelay = delay*textIndex;
t = (time - inPoint) - myDelay;
if (t >= 0){
freq =3;
amplitude = -100;
decay = 1.0;
s = amplitude*Math.cos(freq*t*2*Math.PI)/Math.exp(decay*t);
[s,s]
}else{
value
}


Dan



Return to posts index


Charlie Aquino
Re: Per Character Bounce Scale
on Aug 18, 2011 at 4:51:22 pm

Superb! Thanks Dan.


Return to posts index

Jake Williams
Re: Per Character Bounce Scale
on Jun 24, 2013 at 3:55:25 am

Great expressions Dan!

I've been tweaking the expression to attempt to get a "Back" sort of animation where a word starts at 0, overshoots it's scale, then settles back at it's regular size. Would there be a way to tweak the expression so that it only does the one motion and stops bouncing?

-Jake


Return to posts index

Dan Ebberts
Re: Per Character Bounce Scale
on Jun 24, 2013 at 4:19:57 am

I'd say start with something like this:


delay = .1;
myDelay = delay*textIndex;
t = (time - inPoint) - myDelay;
if (t >= 0){
freq =2;
amplitude = -200;
decay = 15;
s = amplitude*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
[s,s]
}else{
value
}



Dan



Return to posts index


Jake Williams
Re: Per Character Bounce Scale
on Jun 24, 2013 at 2:58:00 pm

Thanks Dan, this is a great place to start. I think I can tweak it from here!

Much appreciated.

-Jake


Return to posts index

Andrea Digiorgio
Re: Per Character Bounce Scale
on Oct 18, 2013 at 3:16:31 pm

Hi, i have a question about. I used it for "animate in" a word and it works, is there a way to "animate out"? I tried but maybe i don't know what is the parameter to set.

Thanks


Return to posts index

Federico Cocheo Filetti
Re: Per Character Bounce Scale
on Oct 19, 2013 at 8:42:15 am

You have to duplicate the entire animator and then all you need to do is change the the "t" variable from:"t = (time - inPoint) - myDelay;"
to "t = (outPoint - myDelay) - time;".

Hope it helped! :P


Return to posts index

Chad Shack
Re: Per Character Bounce Scale
on Jan 8, 2014 at 3:50:23 pm

I've tried applying the expression as mentioned above and am getting no action what so ever. I have attached a screen grab of the simple set up as described. What have I missed in setting this up?



Thanks,

Chad


Return to posts index

Dan Ebberts
Re: Per Character Bounce Scale
on Jan 8, 2014 at 6:15:23 pm

For scale, I think you'd want something more like the second expression in the Calculation Overshoot section of this article:

http://www.motionscript.com/articles/bounce-and-overshoot.html#calc-oversho...


Dan



Return to posts index

Jaqai Mickelsen
Re: Per Character Bounce Scale
on Nov 5, 2014 at 1:19:39 pm

This string has been an amazing help. So, two things.

First, thank you very much. I'm waaaaay closer now than I was when I started, all thanks to you.

Second, in the digging I've done around these here internets, to use an expression with text animators, you're pretty much getting rid of the range selector. I'm curious to know if there's a way to have the best of both worlds?

In short, I'm matching the words up with what is being said by a voiceover, so I'd love to be able to get in there and tweak the timing for "per word bounce out" alignment.

Think William Shatner as Captain Kirk delivering a line. Is there a way to easily align the triggers for each word's bounce out animation to align with when it's being said?



Return to posts index

Dan Ebberts
Re: Per Character Bounce Scale
on Nov 5, 2014 at 2:37:00 pm

You could try something like this to time the reveal of each word with layer markers:


freq = 3;
decay = 5;
startVal = [100,100];
endVal = [0,0];
dur = 0.1;

try{
t = time - marker.key(textIndex).time;
}catch (err){
t = 0;
}

if (t > 5){
endVal
}else if (t > 0){
if (t < dur){
linear(t,0,dur,startVal,endVal);
}else{
amp = (endVal - startVal)/dur;
w = freq*Math.PI*2;
endVal + amp*(Math.sin((t-dur)*w)/Math.exp(decay*(t-dur))/w);
}
}else
startVal



Dan



Return to posts index

Jaqai Mickelsen
Re: Per Character Bounce Scale
on Nov 5, 2014 at 4:18:51 pm

Perfect! My goodness. I feel like every After Effects user needs to work together on getting a statue erected in your in your honor. You just saved me a ridiculous amount of time.

Thank you VERY much.



Return to posts index

Stacy Obakpolor
Re: Per Character Bounce Scale
on Oct 15, 2015 at 8:20:01 pm

Thank you so much for all your help!! This will save me a tremendous amount of time. You're a saint.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]