ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Grabbing source.Text from one layer and incorporating it into a layer with an expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Richard Torres
Grabbing source.Text from one layer and incorporating it into a layer with an expression
on Aug 2, 2012 at 3:17:11 pm

Hey Guys,

This is my first post so any help will be appreciated. I've been piecing together an expression for a text layer. It should simulate typing and deleting (expression attached) while controlling the start, duration and animation speed. Now I need that expression layer to use the text from another layer in a different comp. Does anyone know how I can integrate that into my code?

Thanks,

F=Math.round(time%1);
L=text.sourceText.length;
T=time*thisComp.layer("Controller Sliders").effect("Speed")("Slider")-thisComp.layer("Controller Sliders").effect("Start at")("Slider")*thisComp.layer("Controller Sliders").effect("Speed")("Slider");
D=thisComp.layer("Controller Sliders").effect("Start at")("Slider")+thisComp.layer("Controller Sliders").effect("Duration")("Slider");

if(T>L){(R=L)}else{R=T};
if(time>D){(E=0)}else(E=1);
if(time>D){(G=L-(time-D)*thisComp.layer("Controller Sliders").effect("Speed")("Slider"))}else(G=0);
if(F==1|((R0)|G>0&G<L){Fl="_";}else{Fl=" ";}

substr(0,(E*R)+G)+Fl


Return to posts index

Dan Fredley
Re: Grabbing source.Text from one layer and incorporating it into a layer with an expression
on Aug 8, 2012 at 7:12:26 pm

Try this:

myText = comp("Name of Comp").layer("Name of Layer").text.sourceText;
L = myText.length;

F=Math.round(time%1);
T=time*thisComp.layer("Controller Sliders").effect("Speed")("Slider")-thisComp.layer("Controller Sliders").effect("Start at")("Slider")*thisComp.layer("Controller Sliders").effect("Speed")("Slider");
D=thisComp.layer("Controller Sliders").effect("Start at")("Slider")+thisComp.layer("Controller Sliders").effect("Duration")("Slider");

if(T>L){(R=L)}else{R=T};
if(time>D){(E=0)}else(E=1);
if(time>D){(G=L-(time-D)*thisComp.layer("Controller Sliders").effect("Speed")("Slider"))}else(G=0);
if(F==1|((R0)|G>0&G<L){Fl="_";}else{Fl=" ";}

myText.substr(0,(E*R)+G)+Fl


Return to posts index

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