Thanks for the replies, but not quite there. Dan, it’s close to what you are doing, except I don’t want to have to duplicate the comps themselves in the project window, rather just the layer that contains the comp in the timeline. This way, I can continue to make changes to the animation of the precomp without having to match the animation multiple times.
I took what you sent though and messed with it a bit and got it closer to what I want, but still not perfect.
To explain a bit better, I have Comp 1 which contains the text layer and some circles that animate. I put that into Comp 2 and turn it into a 3d layer, then animate that. Now I’d like to duplicate that 3d layer and change it’s position / animation / etc, but retain the original precomped animation of circles. It works great, but all the text is the same. I need to access the layer name in Comp 2 inside of Comp 1, and set the text based on that. So if i name the layer “Title 1” it pulls the array item 1 to the text in the precomp.
Here’s what I have so far, put onto the source text expression in Comp 1:
a = [‘test 1’, ‘title two’, ‘myTitle’];
a [ parseInt ( comp ( “Comp 2″ ).layer( 1 ).name.split(” “) [ 1 ] ) ];
This works, but I still have to explicitly say layer(1). So I can change the text to be whichever I want by renaming the layer in Comp 2, but it still only looks at the first layer in Comp 2 and sets them all.
Is there a way to make layer(1) be dynamic as well? How can I change a variable in the parent comp and make the current layers expression in Comp 2 say something like :
comp( “Comp 1″ ).currentLayerVar = thisComp.layer.name;
Then I could put this into Comp 1’s text expression:
a [ parseInt ( thisComp.currentLayerVar.split(” “) [ 1 ] ) ];