Skip to main content
Mr. Towers
Participant
Mar 31, 2024 12:36 AM UTC
Question

Adding effects to a Comp or Precomp

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 is closed to new replies. Start a new post to keep the conversation going.

4 replies

Dan Ebberts
Community Expert
Community Expert
Mar 31, 2024 3:48 AM UTC

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
Mr. Towers
Participant
Mar 31, 2024 5:10 AM UTC

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
Dan Ebberts
Community Expert
Community Expert
Mar 31, 2024 5:48 AM UTC

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