Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Set an expression value to a layers name.

  • Set an expression value to a layers name.

    Posted by Lucas Malaquias on March 17, 2020 at 7:47 pm

    Hi, friends!

    I am looking a solution for a relatively simple problem, but I’m not sure if there is a solution.

    I am using a plugin called Templater. Using that plugin, I can change a layers name using a Google Sheet, for example.

    Because of that wanted to be able to change this expression by linking the “veloc” to another layers name.

    This is the expression

    veloc = 140;
    x = position[0] + (time – inPoint) *veloc;
    y = position[1];
    [x,y]

    Instead of “140” I wanted this value to be another layer’s name. That way, I can use the Templater plugin to change the name of the layer, and this will change the velocity that the text changes.

    That’s basically what I’m trying to achieve, if I change the layer name to 20, I want the expression to set its velocity to 20.

    Hope this is clear enough, thank you!

    veloc = 140;
    x = position[0] + (time - inPoint) *veloc;
    y = position[1];
    [x,y]

    Lucas Malaquias replied 6 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    March 17, 2020 at 11:05 pm

    Like this maybe:

    veloc = parseInt(thisComp.layer(1).name,10);
    x = position[0] + (time – inPoint) *veloc;
    y = position[1];
    [x,y]

    Dan

  • Lucas Malaquias

    March 17, 2020 at 11:44 pm

    Thank you, Dan! Worked like a charm.

    For other people that may end up with the same problem, I’ve also found that using the source text as a value works really well. Using this:

    veloc = parseInt(thisComp.layer(“layerName”).text.sourceText)
    x = position[0] + (time – inPoint) *veloc -300;
    y = position[1];
    [x,y]

    Thanks again, Dan! You’re the best.

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