Copy link to clipboard
Copied
I'm trying to programmatically add an adjustment layer to my comp. The adjustment layer creates a vignette effect, and is inside another comp inside another project (vignetteProject). Here is my code:
var vignetteComp = vignetteProject.item(vignetteIndex)
comp.layers.add(vignetteComp.layer(1))
On the second line here, I get an error reading "unable to call 'add' because of parameter 1. [object AVLayer] is not of the correct type".
I believe it is expecting an AVItem, not an AVLayer. But if that's the case, how am I supposed to add an adjustment layer?
Thank you!
I think it would be like this:
vignetteProject.item(vignetteIndex).layer(1).copyToComp(comp)
Dan
Copy link to clipboard
Copied
You're going about this the wrong way. Create an animation preset and add a solid onto which the preset is applied.
Mylenium
Copy link to clipboard
Copied
Okay, I'll try that! Disappointed that there's no way to add a layer from one comp onto another directly though.
Copy link to clipboard
Copied
I think it would be like this:
vignetteProject.item(vignetteIndex).layer(1).copyToComp(comp)
Dan
Copy link to clipboard
Copied
Thank you, it worked like a charm!