Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions reading expression text from a text layer

  • reading expression text from a text layer

    Posted by Christian Labuska on June 20, 2008 at 9:50 am

    Hi,

    i am looking for a way to read out a text layer (string information) and put it as an expression into another layer (position, ….).

    TEXT LAYER -> “Expression TEXT”
    FOOTAGE LAYER -> read out the expression text and apply it

    I have a project were i have to put the same expression into a bunch of layers. In order to stay flexible i would like to write it down onetime, so i can change it without going through all the layers.

    Is there a way to solve this with an expression or do i need a script?

    Thanks a lot.

    Kristian

    Matthieu Foulet replied 17 years, 9 months ago 5 Members · 9 Replies
  • 9 Replies
  • Trent Armstrong

    June 20, 2008 at 4:33 pm

    If you have a lot of parameters that need to change, you could set up one layer with all Expression Sliders or whatever that are referenced by the expression in each layer. That way you control everything from one place and only have to put your expression on each layer once.

    A little more work is Copying the Expression Only under the EDIT menu. Then select all necessary layers and hit PASTE.

    That keeps you from having to open each expression field.

    It would be cool, though if there is a way to convert the Name of a layer to expression language. Maybe that will be solved by one of our totally awesome expression gurus.

    I hope that helps.
    Trent

    Trent Armstrong – Creative Cow Leader
    https://www.dallasaeug.com

  • Kevin Camp

    June 20, 2008 at 7:23 pm

    it’s an interesting idea, and i can get it to work for single dimension values like opacity…

    a simple expression typed as source text like this:

    random(0,100);

    then linked it to the opacity of another layer with something like this

    thisComp.layer(“ExpressionSource”).text.sourceText.value;

    returns opacity values from the source text value generated by the expression… however, i get errors any time i try to link it to multi-dimension values like position…

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Dan Ebberts

    June 20, 2008 at 7:54 pm

    This seems to work:

    expr = thisComp.layer(“text layer 1”).text.sourceText.toString();
    eval(expr)

    Dan

  • Kevin Camp

    June 20, 2008 at 7:57 pm

    the only way i can figure out how to get multi-dimensional values to work is to use a text layer for each coordinate value… so for 2d position you would need an x text layer and a y text layer, then your position expression for another layer would need to combine them, something like this:

    x = thisComp.layer(“x expression”).text.sourceText.value;
    y = thisComp.layer(“y expression”).text.sourceText.value;
    [x,y]

    and your source text for the ‘x expression” and “y expression” text layers would contain the expressions to drive the respective values….

    i’m not sure this is making things any easier though…?

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Kevin Camp

    June 20, 2008 at 8:10 pm

    this didn’t seem to work for multi-dimensional values like position… i still get an error…?

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Dan Ebberts

    June 20, 2008 at 8:24 pm

    Hmmm….

    Here’s the text for “text layer 1”:

    x = 100;
    y = 100;
    z = 100;
    [x,y,z]

    Here’s my position expression for a 3D solid:

    expr = thisComp.layer(“text layer 1”).text.sourceText.toString();
    eval(expr)

    Dan

  • Kevin Camp

    June 20, 2008 at 8:46 pm

    i had the exact same expressions (for 2d), and it wasn’t working… rebooted now it works.

    thanks, dan

    you know, i’ve had this happen before with expressions… it seems if i work too long in ae, ae just starts forgetting expressions. has anyone else seen this?

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Christian Labuska

    June 23, 2008 at 12:43 pm

    that’s working fine for me. tried it with multi-dimensional values, its’s working. thanks a lot.

  • Matthieu Foulet

    July 30, 2008 at 9:38 am

    Thank you dan !
    And know, what if I wanted to use my text layer to animate more than 1 transformation property ?

    For exemple, is there a way to use some specific values of a text layer like these:

    x = 100;
    y = 100;
    transparency = 50;
    [x,y,transparency]

    in order to animate a second layer ?

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