ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Checkbox Controlled Opacity Easing

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Michael Martin
Checkbox Controlled Opacity Easing
on Sep 22, 2014 at 5:57:24 pm
Last Edited By Michael Martin on Sep 22, 2014 at 6:12:15 pm

Long time lurker-first time poster. I really need some help here...

have a client project with 19 Videos. Each video is highlighting 3 separate qualities in their product. We have called them:

- F&F
- MCL
- IE

When one or more of these attributes is displayed on screen, a text changes from a 0% opacity to 100%. They are linked to a Opacity controller for each individual piece of text and each controller is linked to a MASTER CONTROLLER with 3 check boxes. The goal here is to set only three different keyframes... keep things tidy.... 19 freakin' videos... HA! Hopefully this is painted a decent picture for you guys.

MY ISSUE: All of the "mechanism" is working perfectly. The keyframes on the check boxes all work and control things properly BUT i would like to EASE in and out of the opacity change, rather than the "nature" of a check box being on or off... I am totally at a loss on how to make this happen.

Let me know if I can supply any additional information to help...

if(thisComp.layer("Master Controller").effect("F&F")("Checkbox")==1) 100 else 0;


Return to posts index

Dan Ebberts
Re: Checkbox Controlled Opacity Easing
on Sep 22, 2014 at 7:28:18 pm

Try this:


fadeTime = .5;
cb = thisComp.layer("Master Controller").effect("F&F")("Checkbox");
if (cb.numKeys > 0){
n = cb.nearestKey(time).index;
if (cb.key(n).time > time) n--;
if (n >0){
t = time - cb.key(n).time;
if (cb.key(n).value > 0)
ease(t,0,fadeTime,0,100)
else
ease(t,0,fadeTime,100,0);
}else{
0
}
}else
if (cb.value > 0) 100 else 0



It does assume that the first checkbox keyframe is an on keyframe and that they alternate thereafter.

Dan



Return to posts index

Michael Martin
Re: Checkbox Controlled Opacity Easing
on Sep 22, 2014 at 7:44:09 pm

THIS TOTALLY WORKS! Thanks sooooo much. Lifesaver!

Is there a way to alter the code so it doesn't assume the first keyframe is "ON"?


Return to posts index


Dan Ebberts
Re: Checkbox Controlled Opacity Easing
on Sep 22, 2014 at 7:54:16 pm

This should let the first keyframe be on or off, but they still need to alternate:


fadeTime = .5;
cb = thisComp.layer("Master Controller").effect("F&F")("Checkbox");
if (cb.numKeys > 0){
n = cb.nearestKey(time).index;
if (cb.key(n).time > time) n--;
if (n >0){
t = time - cb.key(n).time;
if (cb.key(n).value > 0)
ease(t,0,fadeTime,0,100)
else
ease(t,0,fadeTime,100,0);
}else{
if (cb.key(1).value > 0) 0 else 100;
}
}else
if (cb.value > 0) 100 else 0


Dan



Return to posts index

Michael Martin
Re: Checkbox Controlled Opacity Easing
on Sep 22, 2014 at 7:56:41 pm

Seriously, thanks so much. You just saved me about 6 hours of setting keyframes.


Return to posts index

Craig Sinclair
Re: Checkbox Controlled Opacity Easing
on Sep 27, 2018 at 1:19:45 pm

You're a legend Dan.

You're so helpful on this forum. Literally every I click on for help, you're there with the answer.


Return to posts index

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