ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Control Layer copied into various comps

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Grayson Sedory
Control Layer copied into various comps
on May 28, 2018 at 3:43:32 pm

Hi, I created a control layer to control position and scale (via Slider Controls) of footage tracked into a monitor from the render comp so the end user can quickly adjust position/scale for the client without jumping into the footage comp.

I have various final comps for different camera moves and studio colors and I wanted to have this control layer available in whatever composition the end user needed to render.

however, currently I'm stuck with one perfectly working control layer but obviously if I copy that into another comp it doesn't work because the expression is referring to that one specific comp's control layer.

Is there a way to create a control layer that finds a specific parameter in another comp and changes it? Rather than a comp referring to the control layer such as a slider control?


Return to posts index

Frederic Antoinette
Re: Control Layer copied into various comps
on May 28, 2018 at 8:38:17 pm

I can see multiple ways of doing that.

One would be to have a a control composition;
In this composition you drop all your finals composition.
Add a Null and in there the Expression Control "Control Layer"
Now in your expression use that Control Layer to point your expression to the correct composition.

Your code for your scale would look like

C = comp("Control Comp").layer("Null 1").effect("Layer Control")("Layer").name;
s = comp(C).layer("The layer on which the slider is on").effect("Slider Control")("Slider");
[s, s]


You can even user your Control Composition as Final render if you add this code to the opacity of each Finals Comp in the Control Composition, to only render the composition you want.

C = thisComp.layer("Null 1").effect("Layer Control")("Layer").name;
If (C == thisLayer.name) 100 else 0


The only problem with this method is that you cannot render queue multiple composition at the same time. You will have to add to Encoder one by one, or it will only take the latest value of the control layer and use that to all your renders.

The other method which I use more frequently would be to add a text layer as guide layer in your footage comp. And use the text in there to name the comp you want to use to control it. Then duplicate that footage comp as many time as necessary and change the text in each comp to match the name of the final composition it is nested in.

This time the code for scale would look like

C = thisComp.layer("The Text layer").text.sourceText.value;
s = comp(C).layer("The layer on which the slider is on").effect("Slider Control")("Slider");
[s,s]


With this method depending on how many final comps you have it takes time to setup, but you won't have that render queue problem you have in the first method.

It’s quite hard trying to explain the method I use. I hope you understood and that it can help.


Return to posts index

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