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

Adding effects to a Comp or Precomp

Community Beginner ,
Mar 30, 2024 Mar 30, 2024

Hi everyone. I'm hitting a bit of a wall when trying to add a simple Checkbox contgrol to a comp the same way I would to a regular Null.

 

var myComp = app.project.activeItem;
var myNull = myComp.layers.addNull();

myNull.name = "Controller";
var nullOnOffControl = myNull.effect.addProperty("ADBE Checkbox Control");
var compOnOffControl = myComp.effect.addProperty("ADBE Checkbox Control");

 

Thanks!

TOPICS
Expressions , Scripting
502
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 ,
Mar 30, 2024 Mar 30, 2024

I don't understand exactly what you're trying to do, but comps don't have effects, so you can't add a checkbox to one. You could add an effect to a comp as a layer in another comp, but it doens't appear that that's what you're trying to do.

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 Beginner ,
Mar 30, 2024 Mar 30, 2024

Hey Dan, Thanks for your reply, please bare with me.

 

It seems like there is no way to add an effect to a Comp item the same way you add it to a Null or a Layer throught scripting (as I showed in my script).  What I find odd is that in After Effects you CAN actually do this manually by creating a precomp within an comp  and right click + add an effect to the pre-comp. 

 

Maybe I'm not explaining myself right, but I'm trying to add effects to a comp within a comp and I'm still not able to do that. I'm not sure what I'm missing here. 

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 ,
Mar 30, 2024 Mar 30, 2024

You'd have to address the precomp as a layer within the comp, like this:

var myComp = app.project.activeItem;
var myPrecomp = myComp.layer("myPrecomp");
var compOnOffControl = myPrecomp.effect.addProperty("ADBE Checkbox Control");

 

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 Beginner ,
Mar 31, 2024 Mar 31, 2024
LATEST

Gotcha! thank you.

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