Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Reference a variable comp name

  • Reference a variable comp name

    Posted by Marko Suto on December 13, 2018 at 3:00 pm

    Hello AE community!

    I’m trying to reference to a composition which is duplicated many times.

    Let me give you an example:

    I have a text layer named “Index” which changes value each time the comp is duplicated

    For example, it’s value is 1.

    a = thisComp.layer(“Index”).text.sourceText;
    x = comp(“name 1” & a ).layer(“^TV1”).sourceRectAtTime(time).height;

    I need it to be “name 1 1”

    For example, it’s value is 2.

    a = thisComp.layer(“Index”).text.sourceText;
    x = comp(“name 1” & a ).layer(“^TV1”).sourceRectAtTime(time).height;

    I need it to be “name 1 2”

    Hope I’ve made it clear enough what’s my problem ☺

    Thanks!

    Marko Suto replied 7 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 13, 2018 at 6:30 pm

    Try it this way:

    a = thisComp.layer(“Index”).text.sourceText;
    x = comp(“name 1 ” + a ).layer(“^TV1”).sourceRectAtTime(time).height;

    Dan

  • Marko Suto

    December 14, 2018 at 8:32 am

    Dan the Daysaver, thanks a lot, again!!! 🙂

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