Copy link to clipboard
Copied
Hello,
I have a fairly complex set of expressions on multiple layers. These layers together make up an overall effect for a piece of footage. For convenience I have these expression linked to a controller null object so I can control them from one place. Now that I have it set up, I want to duplicate the group of layers (footage item, various effects, and null object controller) multiple times. I basically have a template for a footage effect that I want to duplicate multiple times so I end up with many pieces of footage with this effect applied. When I duplicate the group of layers, I'd love to set it up in a way that the expression variables will now point to the duplicated controller object. I noticed this behavior happens if the expression is a simple pick whip from one property to another. Basically a direct connection. But if I attempt to store this pick whip selection in a variable to be manipulated further, this functionality ceases. So my question is, how can I create a set up that will permit me to duplicate layers and have the expressions update as if they were a simple direct pick whip from one property to another? Is this possible? If not, how can I better set this up to allow me to accomplish my end result?
Thanks!
-Justin
If you have things set up so that your layer names end with a space and a number, so that they increment when you duplicate them, you should be able to use the layer's name to navigate to the other layers in the set. For example, if your layers are named "layer 1", "layer 2", etc. and your control layers are named "control 1", "control 2", etc., you could do something like this in your expressions to construct the control layer's name on the fly:
n = name.split(" ");
ctrl = thisComp.layer("control
...Copy link to clipboard
Copied
If you have things set up so that your layer names end with a space and a number, so that they increment when you duplicate them, you should be able to use the layer's name to navigate to the other layers in the set. For example, if your layers are named "layer 1", "layer 2", etc. and your control layers are named "control 1", "control 2", etc., you could do something like this in your expressions to construct the control layer's name on the fly:
n = name.split(" ");
ctrl = thisComp.layer("control " + n[n.length-1]);
Dan
Copy link to clipboard
Copied
Wow, what a great idea! I love it. You really know your After Effects scripting. Thanks a lot for the great tips. The last one you gave me worked perfect.
I'm going to try it out after lunch.
Thanks again!
-Justin
Copy link to clipboard
Copied
Thanks so much for this. It's such a simple, elegant solution. It worked perfect.
Thanks!!
-Justin
Copy link to clipboard
Copied
i found also this script which you need to buy to be able to use. altough Dan's solution makes sense and very elegant, if you are not familiar writing scripts on your own,this is also a good solution;)
Duplicate with Connections - aescripts + aeplugins - aescripts.com
Copy link to clipboard
Copied
tarzantnt wrote
i found also this script which you need to buy to be able to use
...
Duplicate with Connections
That script is not needed with versions of AE after CS6. Copy with Property Links and Copy with Relative Property Links have been in the past several versions of AE.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now