Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions “Inertial Bounce” expression in text layer

  • “Inertial Bounce” expression in text layer

    Posted by Peter Zeet on October 3, 2011 at 8:53 pm

    hi there!
    Im working with several shape layers which I applied the “Inertial Bounce” expression, and I need to do the same with text layers as well (rotation and scale).
    I tried Filip Vandueren`s solution (great solution anyway) here https://forums.creativecow.net/thread/227/13758, but for the workflow of my project will be really faster for me to use the “Inertial Bounce” expression structure (i.e.working with amp = .05; freq = 4.0; decay = 2.0)

    Im not hard at expressions, so after trying with no success, I want to ask you..how to achieve this..

    Many thanks in advance!

    Caitlin Mckenna replied 9 years, 7 months ago 8 Members · 23 Replies
  • 23 Replies
  • Kevin Camp

    October 4, 2011 at 11:41 am

    i think you are looking for something like the expressions provided here:

    https://motionscript.com/mastering-expressions/simulation-basics-3.html

    you can use most of those in any transform property, or even in a text animator.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Peter Zeet

    October 4, 2011 at 1:34 pm

    hey, thanks for the refs!
    I played around with the pendulum thing added to a expression selector in the text layer… but if I try to add this expression below to the expression selector (with, x rotation from 90º to 0º just to test.. nothing happens there…

    maybe it`s something to do with adding the textIndex somewhere in the script…? (you know, the idea is playing with rotation, and scale, and have all text characters animating and bouncing a bit in order… like having a bunch of layers animated with delay..)

    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 = .05;
    freq = 4.0;
    decay = 2.0;
    value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
    }else{
    value;
    }

  • Kevin Camp

    October 4, 2011 at 2:31 pm

    [Peter Zeet] “maybe it`s something to do with adding the textIndex somewhere in the script…? (you know, the idea is playing with rotation, and scale, and have all text characters animating and bouncing a bit in order… like having a bunch of layers animated with delay..)”

    so your looking for the individual characters to be moving/bouncing around…

    if so, an easier way is to apply the ‘text bounce’ animation preset, then add a rotation text animator to the expression selector and set x rotation to 90. you can either delete the position animator or set it to zeros [0,0,0], but i think that will give you what you’re after…

    not saying you can’t do it with the expressions from motion script (the math is pretty much the same), but this may be mostly done for you…

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Peter Zeet

    October 4, 2011 at 2:58 pm

    hey! thanks Kevin for your guidelines!
    but I think I’m doing something wrong at some step here…
    so basically:
    1. I add the expression animator, and add the inertial bounce code there, and set the x rotation animator to 90..
    2. animate the Amount from 100 to 0 (or viceversa, just animate it)
    3.wait excited
    4.it rotates and bounces… but as a whole element (like based on Lines instead of characters)

    The idea of using that specific script is because I`m using it for a bunch of layers in te project, and I was using the script I attach below, written by Filip Vandueren, and worked like a charm.. but I found it a more bit difficult to tweak all params to get smoother animations than the “inertial bounce” script…

    anyway, thanks for being there 🙂

    swings=3;
    timeOffset=0.25;

    v=valueAtTime(time-timeOffset*textIndex/textTotal)[0];

    anim=2*Math.PI*v/100;
    amp=easeOut(v,0,100,100,0);

    Math.cos(anim*swings)*amp;

  • Kevin Camp

    October 4, 2011 at 3:15 pm

    that should work…

    check the ‘based on’ property of the expression selector, make sure it is set to characters, not words or lines.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Peter Zeet

    October 4, 2011 at 3:36 pm

    yes, everything there set to chars…mmm
    …maybe is there something in the code I should add to deal with the time offset? like in the Filip Vandueren script:
    timeOffset=0.25;
    v=valueAtTime(time-timeOffset*textIndex/textTotal)[0];

  • Kevin Camp

    October 4, 2011 at 4:15 pm

    if you are using an expression from the motionscript.com page, then yes it would need to account for the character offset and index.

    but if you tried the text bounce preset it will give you the amount, decay and offset sliders with the expression, you should just need to add rotation and scale animators (and remove the position) to get what i think you are after.

    and just to double check… filip’s expression works, but you just need more control, correct?

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Peter Zeet

    October 4, 2011 at 4:35 pm

    yes, Filip`s works great, is just I needed more control, and use a expression which can integrate easily with the project..
    Sorry, maybe I should have explained it before so its easier to understand..
    I have a lot (a lot) of shape layers, controlled by a “controller” null (kinda “follow the leader”), with amp, freq, decay and delay sliders to animate those parameters, so they rotate and grow with some delay and nice bouncy effect. At some point I have to add a bunch of text layers.. so they must fit the overall animation and feel, inside the “growing and bouncing” set. I would do it as separate shape layers (converting types to shape layers), or using that useful decompose text script.. but as it`s probably to make changes in the words in the future.. can be a really bad idea..
    So i played a bit with Filip´s expression, but didn`t get the results I need to fit the whole thing…so I thought, “hey, lets change Filip`s expression with the “inertial bounce” I`m using in the project, and probably it even work with the sliders in the main controller”…. but didn`t work at all (as its getting all the word rotated as a whole no matter it is set to “characters”, the idea of a need of adding that time offset came…)

    buf, long read, thanks for read until here!

  • Dan Ebberts

    October 4, 2011 at 9:09 pm

    I’d jump in here, but I’m still not sure what you’re trying to do. What “inertial bounce” expression are you talking about? What triggers it?

    Dan

  • Peter Zeet

    October 4, 2011 at 9:30 pm

    Hi Dan, just as a quick explanation, Im using on the project the expression below:
    :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 = .05;
    freq = 4.0;
    decay = 2.0;
    value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
    }else{
    value;
    }

    mainly on the scale and rotation properties of the controller (this, plus a delay, makes all layers grow and swing a bit on a nice way).
    The null has 3 sliders, so I can animate the freq., amp. and decay.
    I have to add several words on the comp, which each letter animated with same feel (i.e, its growing seqientially a rectangle, another rectangle, a circle on top, the word flower so first “f”, then “l”, ecc, then a rectangle, ecc)
    So, I played a bit with Filip´s expression:
    swings=3;
    timeOffset=0.25;

    v=valueAtTime(time-timeOffset*textIndex/textTotal)[0];

    anim=2*Math.PI*v/100;
    amp=easeOut(v,0,100,100,0);

    Math.cos(anim*swings)*amp;

    ..but I was wondering how could I adapt the first expression so it can work in the expression selector…

Page 1 of 3

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy