ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Timewarp Source Frame increment script

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Cesar Delarosa
Timewarp Source Frame increment script
on Feb 2, 2018 at 7:24:55 am

Hello, I have been trying to write a script that will increment the value of the Source Frame in the Timewarp FX. Basically what I want to do is have a Checkbox control that when checked will have the Source Frame value increase by 1, starting at 0 from the time the checkbox is checked, when unchecked the Source Frame resets to 0. I can't seem to find anything online remotely to what I am trying to accomplish. Any help is greatly appreciated.

if (thisComp.layer("Black Solid 1").effect("Checkbox Control")("Checkbox")==1) ________
else 0


Return to posts index

Dan Ebberts
Re: Timewarp Source Frame increment script
on Feb 2, 2018 at 9:27:07 pm

Try this:


c = thisComp.layer("Black Solid 1").effect("Checkbox Control")("Checkbox");
if (c.numKeys > 0){
n = c.nearestKey(time).index;
if (time < c.key(n).time) n--;
if (n > 0){
if (c.key(n).value){
timeToFrames(time-c.key(n).time);
}else{
0;
}
}else{
0;
}
}else{
0;
}


Dan



Return to posts index

Cesar Delarosa
Re: Timewarp Source Frame increment script
on Feb 3, 2018 at 5:32:11 am

OMG that is exactly what I needed. I still can't wrap my head around the logic, but thank you so much!


Return to posts index

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