ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

time remap to start animation if value of a slider reaches a set value

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Florian Motz
time remap to start animation if value of a slider reaches a set value
on Jul 5, 2017 at 12:37:10 pm

Hi all,
I have been searching the Forum but havent found anything I could use or understand.
My Problem is the following: I want to use time-remapping to start playing compA when a slider Value is exceeded.
As long as the opacity is 0, update the playtime in fixedtime and then use this value to correct the comp playtime when the opacity changes.
BUT apparently fixedtime is not available in the else Statement (error).

if (comp("main").layer("Transparency_Control").effect("Effect")("Slider") == 0){

timeRemap = 0;
fixedtime = valueAtTime(time);

}else{

timeRemap = comp("main").layer("focus").time - fixedtime;


}


Please help me with the final hint I am missing.


Return to posts index

Dan Ebberts
Re: time remap to start animation if value of a slider reaches a set value
on Jul 5, 2017 at 3:37:05 pm

Expressions don't have memory, so your expression will have to loop through time, looking for the event. Something like this probably:


sl = comp("main").layer("Transparency_Control").effect("Effect")("Slider");
threshold = 0;
f = timeToFrames(time);
for (i = 0; i <=f; i ++){
t = framesToTime(i);
if (sl.valueAtTime(t) > threshold) break;
}
time - t;



Dan



Return to posts index

Florian Motz
Re: time remap to start animation if value of a slider reaches a set value
on Jul 6, 2017 at 2:09:20 pm

thanks for clarifying. Worked for me.


Return to posts index

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