How to enable/disable keyframes with a checkbox in after effects
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Let me start with a disclaimer. I have not tried this in the Extended Graphics workspace, but I think it would work.
Add a null to the comp with an expression control checkbox.
Create an expression to move a target layer that uses the layer in point and out point and a linear or ease in method to move the layer. Use an if/else statement that checks the expression controller to add the movement. This one would work for Position.
movTime = .5; // number of seconds for move
stopMove = thisComp.layer("Controller").effect("Checkbox Control")("Checkbox");
sTime = time - inPoint;
endTime = time - outPoint + movTime;
sizeX = thisLayer.width / 2;
strt = 0 - sizeX;
rstx = value [0];
endX = thisComp.width + sizeX;
y = value[1];
stMove = easeIn(sTime, 0, movTime, strt, rstx);
endMove = easeOut(endTime, 0, movTime, rstx, endX)
if (sTime < movTime){
mov = [stMove, y];
}
else{
mov = [endMove, y];
}
if (stopMove == 1){
value;
}
else{
mov;
}
I'll check it with a Mogrt when I get time to see if it works with protected areas in Premiere Pro. It should move any layer in from the left side of the comp and then out with both moves taking a half-second. If you want to move a text layer, you'll need to replace thisLayer.width with thisLayer.sourceRectAtTime().width to get the size of the text layer.

