ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to autospeed typing

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Paul Hicks
Expression to autospeed typing
on Jan 18, 2018 at 12:42:15 pm

Hi everybody.

I need some help. I'm doing lots of typing on text lines, all with different lengths / character counts.

Does someone know an expression to enable automatic typing on speed to match the amount of characters so the lines / characters come on the same speed. For example a line "help me" would come on a lot quicker that "please help me as I'm stuck".

So maybe there's a way to make the, {text.sourceText.length} for example, to change the speed of typing on range selector.

I hope that's clear and thanks in advance.

Paul


Return to posts index

Kevin Camp
Re: Expression to autospeed typing
on Jan 18, 2018 at 6:10:54 pm

it's a little easier if you do it without text animators...

try this in the source text property:

rate = 20 ; // characters per second
txt = text.sourceText ;
n = txt.length ;
d = time * rate ;
if ( n > d ) txt.substr( 0, d ) else txt ;


you can do something similar with a text animator, but you'll likely want to change the 'units' from percentage to index. you'll also have to add a text.sourceText.length expression to the end property so that it is always the correct length -- or you might be able to set it to a very high value, high enough that your text would never exceed it....

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Kevin Camp
Re: Expression to autospeed typing
on Jan 19, 2018 at 1:02:17 am

here's an expression for the offset property of a text animator:

rate = 20 ;
n = text.sourceText.length ;
d = time * rate ;
if ( n > d ) d else n


remember to set the units to index (in the advanced properties of the range selector) and to increase the end property to exceed the maximum amount of text that you will type (or use the text.sourceText.length expression)

if the pinpoint of the layer is not at the first frame of the comp, change line 3 to this:

d = ( time - inPoint ) * rate ;

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

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