Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Grabbing source.Text from one layer and incorporating it into a layer with an expression

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

    Posted by Richard Torres on August 2, 2012 at 3:17 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

    Dan Fredley replied 13 years, 11 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Fredley

    August 8, 2012 at 7:12 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

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