FORUMS: list search recent posts

Animate source text within a range

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Christine Edwards
Animate source text within a range
on Mar 19, 2018 at 4:47:50 pm

Hello I'm wondering if its possible to animate the source text of a defined range within a single text layer. I have a title that reads:
$669B
for fiscal year 2018

and I want to count up the numbers to read:

$686B
for fiscal year 2019.

I know how to parent the source text keyframes of the numbers to a slider, but then they'd need to be on their own layer correct? I've tried adding a text range but this doesn't seem to work, the whole layer is affected by the expression.

I've also tried animating the character offset with a defined range and slider, but can't get the exact numbers I need to scroll.

I'm just trying to avoid having to isolate all my numbers from the rest of the title and sorta eyeballing spacing , as I'm making a lot of them.

Macbook 2.7 Ghz Intel Core i7 / 8GB 1600MHz DDR3 / NVIDIA GeForce GT650M 1024 MB graphics / Apple Thunderbolt Display /
OS X 10.8.4


Return to posts index

Kevin Camp
Re: Animate source text within a range
on Mar 19, 2018 at 5:09:05 pm

you could use 2 sliders ,one for dollars and one for year. then link those values to 2 variables in the expression and construct the rest of the text needed around those variables....

so add and slider to a text layer and duplicate it, so you have "slider control" and "slider control 2".

then try this expression:
dollars = "" + effect("Slider Control")("Slider") ;
year = "" + effect("Slider Control 2")("Slider") ;
"$" + dollars + "B" + "\r" + "for fiscal year " + year ;

then keyframe the slider values.

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Christine Edwards
Re: Animate source text within a range
on Mar 19, 2018 at 5:58:56 pm

wow the magic of scripting. thanks I will try this!

Macbook 2.7 Ghz Intel Core i7 / 8GB 1600MHz DDR3 / NVIDIA GeForce GT650M 1024 MB graphics / Apple Thunderbolt Display /
OS X 10.8.4


Return to posts index


Christine Edwards
Re: Animate source text within a range
on Mar 19, 2018 at 6:09:17 pm

to be clear, I'm adding the expression to the source text keyframe correct? I'm getting an error when I add this expression there.

Macbook 2.7 Ghz Intel Core i7 / 8GB 1600MHz DDR3 / NVIDIA GeForce GT650M 1024 MB graphics / Apple Thunderbolt Display /
OS X 10.8.4


Return to posts index

Kevin Camp
Re: Animate source text within a range
on Mar 19, 2018 at 6:41:04 pm

yes, it should be added to the source text property (and the sliders should be added to the text layer, or you'd need to adjust the expression).

it would help to know the error, but it might be due to the backslash in the last line. those often get converted to html character codes when posting.. i'll try a pre format tag....
dollars = "" + effect("Slider Control")("Slider") ;
year = "" + effect("Slider Control 2")("Slider") ;
"$" + dollars + "B" + "\r" + "for fiscal year " + year ;


Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Christine Edwards
Re: Animate source text within a range
on Mar 19, 2018 at 7:29:32 pm

the error reads:
Expression disabled. error at line 1 in property 'Source Text' of layer 1('$669Bto the Pentagon for fiscal year 2018) in comp 'Comp 2'.
Expected: ;.


Is it missing a closing semi colon somewhere?

Macbook 2.7 Ghz Intel Core i7 / 8GB 1600MHz DDR3 / NVIDIA GeForce GT650M 1024 MB graphics / Apple Thunderbolt Display /
OS X 10.8.4


Return to posts index


Kevin Camp
Re: Animate source text within a range
on Mar 19, 2018 at 10:44:46 pm

as long as the first line has a semicolon at the end (just one), it should be fine...

i went ahead and made this as a preset:
12268_dollarsyear.ffx.zip

download and install that in your after effects/presets folder, then in after effects go to the effects & presets palette, click on the hamburger menu and choose "refresh list" and you should be able to find it in the preset folder.

with a text layer selected in the comp, double-click the preset. it should add two sliders and the expression.

I also set the expression to round the values, so you don't get decimal values.

If you are still having issues, try a restart....

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

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