ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Checkbox to control Freeze frame

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Pedro Amaral
Checkbox to control Freeze frame
on Jul 19, 2018 at 1:39:21 pm

Hi,

I'm trying to get an animated composition to freeze if a checkbox is on, and resume if checkbox is off.

Is this possible to do via expressions?

Thanks in advance
P


Return to posts index

Dan Ebberts
Re: Checkbox to control Freeze frame
on Jul 19, 2018 at 3:44:36 pm

You could turn on time remapping for your comp layer and control the playback with a checkbox using a time remapping expression like this:


p = thisComp.layer("Layer 1").effect("Checkbox Control")("Checkbox");
t = 0;
if (p.numKeys > 0){
n = p.nearestKey(time).index;
if (p.key(n).time > time) n--;
if (n > 0){
for (i = 1; i <= n; i++){
if (p.key(i).value == true){
if (i < n){
t += p.key(i+1).time - p.key(i).time;
}else{
t += time - p.key(i).time;
}
}
}
}
}
t



Dan



Return to posts index

Pedro Amaral
Re: Checkbox to control Freeze frame
on Jul 19, 2018 at 3:47:14 pm

Thank you so much Dan,

That should make it.

P.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]