FORUMS: list search recent posts

Checkbox control initiating interpolation

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
James Fitzpatrick
Checkbox control initiating interpolation
on Dec 20, 2012 at 10:20:51 pm

I have 16 separate "Checkbox Control" effects in my master comp controlling 16 separate values for "Distortion Percentage" on Liquify effects in a precomp. Right now the checkboxes are simply switching the percentages from 0 to 100.

Here is what I would like to happen: when I click the checkbox control On it sets the value one frame before to 0 and one frame after to 100, so it interpolates the percentage over three frames using the keyed frame as the central frame. And reverse for switching the checkbox control Off.

Any help would be greatly appreciated.

This is the if statement I had before I ventured out on my own and got nowhere:

if (comp("Front_body").layer("Head").effect("AI2")("Checkbox") == 1) 100 else 0


Return to posts index

Dan Ebberts
Re: Checkbox control initiating interpolation
on Dec 20, 2012 at 11:56:38 pm

I think this works:


cb = comp("Front_body").layer("Head").effect("AI2")("Checkbox");
if (cb.numKeys > 0){
k = comp("Front_body").layer("Head").effect("AI2")("Checkbox").nearestKey(time);
f = thisComp.frameDuration;
t0 = k.time-f;
t1 = k.time+f;
v0 = cb.valueAtTime(t0);
v1 = cb.valueAtTime(t1);
ease(time,t0,t1,v0,v1)*100;
}else
cb.value*100;



Dan



Return to posts index

James Fitzpatrick
Re: Checkbox control initiating interpolation
on Dec 21, 2012 at 1:04:20 am

Yes, this works wonderfully. Although, the "Off" interpolation from 100 to 0 starts at the keyframe, instead of the frame prior, but I changed it anyways so the initial interpolation would end at my "On" keyframe.

Thank you so much, Dan.

cb = comp("Front_body").layer("Head").effect("AI2")("Checkbox");
if (cb.numKeys > 0){
 k = comp("Front_body").layer("Head").effect("AI2")("Checkbox").nearestKey(time);
 f = thisComp.frameDuration;
 t0 = k.time-(2*f);
 t1 = k.time;
 v0 = cb.valueAtTime(t0);
 v1 = cb.valueAtTime(t1);
 ease(time,t0,t1,v0,v1)*100;
}else
 cb.value*100;


Return to posts index

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