Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Character Scale Animation based on length of text

  • Character Scale Animation based on length of text

    Posted by Chris Standley on October 4, 2011 at 1:28 pm

    Hello
    I find it really irritating when I choose a “text animate in” preset that it is a pre-defined duration and I have to alter the keyframes to get the timing as I would like it. It is especially frustrating when you are working with many pieces of text that you want to animate on in the same way – short sentences pop on slowly, long ones come on fast.

    So – is there an expression that I can use to 1. deduce the number of charaters in a text layer (I already know there is: n = text.sourceText.length;) and 2. to use this figure to time the duration of the animation?

    So, if the text layer contains 25 characters, the animation takes 25 frames to complete, from 0% to 100%. If it contains 50 characters, it takes 50 frames, etc.

    Any thoughts?

    Thanks – Chris

    Dan Ebberts replied 14 years, 7 months ago 3 Members · 4 Replies
  • 4 Replies
  • Kevin Camp

    October 4, 2011 at 1:43 pm

    yup… you should be able to switch the value from percentage to index (twirl down options, it will be in ‘advanced’), this should allow you to specify the character count for completion (ie, 25 would equal 25 characters).

    then you could use an expression like this in the offset:

    timeToFrames();

    to advance one character per frame.

    note, you could use percentages and change the offset expression to:

    100*timeToFrames()/text.sourceText.length;

    which would then return a percentage based on the text length.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Chris Standley

    October 7, 2011 at 12:52 pm

    That’s fantastic! I knew there would be a way, but when it comes to working out new expressions I’m lost!
    I think this is a really valuable expression (it’s going to save me hours) and worth spreading around – thank you so much.

  • Chris Standley

    October 7, 2011 at 3:21 pm

    Ah – found an issue.
    This expression only works then the text is at the start of the comp – i.e. Zero frames.
    As soon as you move it along the timeline, the expression screws up.

    Any thoughts?

    Chris

  • Dan Ebberts

    October 7, 2011 at 5:22 pm

    Where you’re using timeToFrames(), change it to timeToFrames(time-inPoint).

    Dan

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