Skip to main content
Mr. Towers
Participant
March 31, 2024
Question

Adding effects to a Comp or Precomp

  • March 31, 2024
  • 1 reply
  • 486 views

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!

This topic has been closed for replies.

1 reply

Dan Ebberts
Community Expert
Community Expert
March 31, 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.

Mr. Towers
Participant
March 31, 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. 

Dan Ebberts
Community Expert
Community Expert
March 31, 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");