-
Enable/Disable a layer’s effects with expressions(checkbox)
First of all, I want to apologise if this question is too simple or has been asked before(if it has, I could’nt find it).
I am quite new to AE and the expression language, and what you can and cannot do with it.
So…
I have a text layer with the effect “Bad TV Old” applied to it.
I want to be able to switch this effect on and off with a checkbox and therefore, with keyframes.
I have added a checkbox expression(effect) and attempted to add some expression script to enable and disable each effect in the layer.
Is this even possible? I have searched for examples and info, but can’t find any for the methods I need. The effects have no properties like “Opacity”, that I can manipulate to get an on/off effect(e.g.”Wave Warp”). The kind of code i feel comes to mind is something like the following(as you can probably see, I’m used to C#):
_checkBox = effect("Enable Effects")("Checkbox");
if (_checkBox.value == 1)
{
thisLayer.effects.enabled = true;
}
else
{
thisLayer.effects.enabled = false;
}or
_checkBox = effect("Enable Effects")("Checkbox");
if (_checkBox.value == 1)
{
thisLayer.effect("Wave Warp").enabled = true;
}
else
{
thisLayer.effect("Wave Warp").enabled = false;
}