ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Linking Text Sources based on Comp and Layer Numbers

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Daniel Gillies
Linking Text Sources based on Comp and Layer Numbers
on Feb 7, 2019 at 9:34:26 pm

I have a set of Comps for a series of title cards, "1_Name Template," "2_Name Template," "3_Name Template," etc...

I am attempting to parse the number from each comp name, and pull Source Text from "Name Title Comp" from layers named,
"1_Name" and "1_Title"

"2_Name" and "2_Title"


I can't quite figure out how to port an expressed number value into a layer name.


Pardon my lack of eloquence, I'm fairly new to this and having a hard time describing my efforts.

Thanks!

compNum = parseInt(thisComp.name);

comp("Name Title Comp").layer(compNum"_Name").text.sourceText


Daniel Gillies - Danger Media, LLC.
Editorial / Motion Graphics / And Stuff
:: dangermedia@me.com
:: http://linkd.in/1mJsdIo
:: http://vimeo.com/dgillies/2014reel


Return to posts index

Dan Ebberts
Re: Linking Text Sources based on Comp and Layer Numbers
on Feb 7, 2019 at 10:45:43 pm

I think I'd do it like this:

compNum = thisComp.name.split("_")[0];
comp("Name Title Comp").layer(compNum + "_Name").text.sourceText


Dan



Return to posts index

Daniel Gillies
Re: Linking Text Sources based on Comp and Layer Numbers
on Feb 8, 2019 at 7:18:56 pm

Worked fantastically, Thanks so much!


Return to posts index

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