Page 1 of 1

reference a comp by something other than name

Posted: February 26th, 2007, 8:10 am
by byronnash
I have an expression that links to a layer in another comp. The user can adjust values of properties in the master comp and not have to go into all the precomps. Then I am using a script to create scores of versions and the master comp gets renamed thus breaking all my expressions. I can't think of anyway to get around this other than add the expression in the script (which I would like to avoid). Any ideas?

Posted: February 26th, 2007, 2:50 pm
by Dan Ebberts
The best I can come up with is to have the expressions in the pre-comp pick up the master comp name from a local text layer. Then have the script update the text in the text layer after it creates the new copies of the comps.

So your expressions would look something like this:

compName = thisComp.layer("text").text.sourceText.value;
comp(compName).layer("Purple Solid").rotation

Dan

Posted: February 26th, 2007, 2:57 pm
by byronnash
That's a good idea Dan. I had a text layer in there trying to do something with thisComp.text, but it didn't work obviously. I ran into one other huge problem. My script imports the same project over and over again for versioning. All the expressions referenced a layer in my master comp. Since I did not rename the master comp in each import, I had 118 comps called "lowerthirdy". The expressions all pointed to the same "lowerthirdy" comp instead of the one it should have pointed to. After Effects desparately needs to have unique comp names if they are going to be referencing everything my name only in expressions. That or come up with another way to have the expressions not break when renaming comps.

Posted: March 20th, 2007, 12:00 am
by Mylenium
byronnash wrote:After Effects desparately needs to have unique comp names if they are going to be referencing everything my name only in expressions. That or come up with another way to have the expressions not break when renaming comps.
Yepp. Perhaps we should request access to AE's internal identifiers (which are always unique for each item, regardless of name)

Mylenium