Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Swinging hinge effect for per-character 3d?

  • Filip Vandueren

    July 13, 2009 at 8:45 pm

    Sorry, thought I psoetd an answer to this last week,!

    Here’s how I solved this, though there’s probably several ways to do it:

    • Create a text Layer
    • Enable Text->Animate->Per Character 3D
    • Add an animator “Rotation”, and set X-rotation to +90° (or-90°, or whatever is the starting rotation)
    • Adjust Text->More Options->Grouping Alignment to 0,-100% (this makes the rotation hinge around the top)
    • You can delete the Y and Z rotation properties
    • Delete the “Range Selector”
    • Now add an “Expression Selector“ to the Text Animator
    • twirl down the Selector->Amount and paste this expression:

      delay=0.06; // amount of seconds between each letter
      swings=1.5; // number of times the text will swing before it's done.

      t=valueAtTime(time-delay*textIndex)[0];

      amt=Math.cos(t*Math.PI*(swings*2)/100)*easeOut(t,0,100,100,0);

    • Now to animate the swinging, set keyframes for the amount between [0,0,0] and [100,0,0]
    • You can tweak the expression, I think it’s pretty self-explanatory

    You can add further properies to the same animator, try for example:
    X Rotation=60°
    Opacity= 0
    Fill Brightness=-80%
    Fill Saturation= 40% (if your text is coloured

    To get some fake 3D shading

  • Matthew Geiger

    October 29, 2009 at 3:44 pm

    I used another expression you posted to do something similar. Have’nt used this one yet, looking to make the text swing in from above instead of from below. can this be tweaked to solve that?

  • Will Mcmillian

    February 28, 2010 at 2:42 pm

    How would I adapt this to work on an image rather than a text animator?
    I know it’s probably something very simple I’m missing – thx!

  • Bryan Cleghorn

    February 10, 2011 at 8:40 pm

    Great post, it works perfectly!

  • Nate Vander plas

    March 24, 2011 at 7:24 pm

    If it’s just one image, this would work:
    https://www.motionscript.com/expressions-lab-ae65/pendulum.html

    If you have more than one image, you could just stagger your layers in time, I think.

  • Crystal Wales

    September 5, 2012 at 2:27 pm

    Check out More Options > Grouping Alignment.
    I adjusted the percentage and problem: solved.

  • Giacomo Bompan

    September 13, 2012 at 12:38 pm

    That’s wonderful, I’ve been trying to achieve this the whole day and would have never gotten it without your help!

    I owe you a beer or two 🙂

  • Brian Murray

    June 6, 2014 at 8:02 pm

    This expression is perfect! How would you go about having the characters flip in a random order rather than from left to right?

    delay=0.03; // amount of seconds between each letter
    swings=2.0; // number of times the text will swing before it's done

    t=valueAtTime(time-delay*textIndex)[0];

    amt=Math.cos(t*Math.PI*(swings*2)/100)*easeOut(t,0,100,100,0);

  • Filip Vandueren

    June 7, 2014 at 9:35 am

    This tweak should do the trick:


    delay=0.06; // amount of seconds between each letter
    swings=1.5; // number of times the text will swing before it's done.

    // randomize the index of the character
    // we seed the random generator with timeless=true so that we'll always get
    // the same random value per character each time the expression is evaluated.
    seedRandom(textIndex,true);
    randomIndex=random(textTotal);

    t=valueAtTime(time-delay*randomIndex)[0];

    amt=Math.cos(t*Math.PI*(swings*2)/100)*easeOut(t,0,100,100,0);

    Caveat: It’s not a real “randomise order” the way the range expression does it.
    Instead: every character has a random timing. So in theory this could mean very hypothetically, a lot of characters could animate at the same time.
    Close enough for rock’n’roll though.

    Also, try the same expression on these properties:
    Position: 0,300
    Scale: 60,160%
    Opacity: 0

    for a jump up with some stretch and squeeze bounce.

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