ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Reference a variable comp name

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Marko Suto
Reference a variable comp name
on Dec 13, 2018 at 3:00:54 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!


Return to posts index

Dan Ebberts
Re: Reference a variable comp name
on Dec 13, 2018 at 6:30:41 pm

Try it this way:

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


Dan



Return to posts index

Marko Suto
Re: Reference a variable comp name
on Dec 14, 2018 at 8:32:09 am

Dan the Daysaver, thanks a lot, again!!! :)


Return to posts index

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