Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

expressions - best practice for duplicating layers

Explorer ,
Sep 10, 2014 Sep 10, 2014

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

TOPICS
Expressions
3.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 10, 2014 Sep 10, 2014

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

...
Translate
Community Expert ,
Sep 10, 2014 Sep 10, 2014

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 10, 2014 Sep 10, 2014

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 10, 2014 Sep 10, 2014

Thanks so much for this.  It's such a simple, elegant solution.  It worked perfect.

Thanks!!

-Justin

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 09, 2017 Apr 09, 2017

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 20, 2017 Apr 20, 2017
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines