Skip to main content
Shozib
Participant
May 8, 2022
Question

How to enable/disable keyframes with a checkbox in after effects

  • May 8, 2022
  • 1 reply
  • 779 views
***How to enable/disable keyframes with a checkbox in after effects
Recently I have prepared a text animation template (Premiere Pro) for my client. It has in/out animation. Now my client wants a checkbox button to control (On/Off) the in/out animation. The easy solution I prepare was by adding a Freeze frame to the composition. But now how can I enable/disable the Freeze frame key by checkbox control.
Thanks
This topic has been closed for replies.

1 reply

Community Expert
May 9, 2022

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.