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

Use Extendscript to add a (adjustment) layer to a comp?

New Here ,
Jul 22, 2020 Jul 22, 2020

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!

TOPICS
Error or problem , How to , Scripting , SDK

Views

1.5K

Translate

Translate

Report

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 , Jul 23, 2020 Jul 23, 2020

I think it would be like this:

 

vignetteProject.item(vignetteIndex).layer(1).copyToComp(comp)

 

Dan

Votes

Translate

Translate
LEGEND ,
Jul 22, 2020 Jul 22, 2020

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

Votes

Translate

Translate

Report

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 ,
Jul 23, 2020 Jul 23, 2020

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.

Votes

Translate

Translate

Report

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 ,
Jul 23, 2020 Jul 23, 2020

Copy link to clipboard

Copied

I think it would be like this:

 

vignetteProject.item(vignetteIndex).layer(1).copyToComp(comp)

 

Dan

Votes

Translate

Translate

Report

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 ,
Jul 23, 2020 Jul 23, 2020

Copy link to clipboard

Copied

LATEST

Thank you, it worked like a charm!

Votes

Translate

Translate

Report

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