ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Controlling Time Indicator with a slider

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Glenn Tak
Controlling Time Indicator with a slider
on Dec 27, 2017 at 4:17:15 am

I have created a faux interface for a movie player. I have a slider controlling the position of the fake control. I would like to have the same slider control the video that is in my precomp. So when I pull the slider, the video underneath follows.


Is this possible?


Thanks in Advance!


TAK

______________________

"Nothing is Easy"
Jethro Tull


Return to posts index

Dan Ebberts
Re: Controlling Time Indicator with a slider
on Dec 27, 2017 at 6:50:18 am

>Is this possible?

It should be. Just turn on time remapping for the video layer and use an expression to link the video time to the slider. Time remapping expects a value in seconds, so you need to do whatever math is necessary to convert the slider value to the desired video time in seconds. Shouldn't be too tough.

Dan



Return to posts index

Glenn Tak
Re: Controlling Time Indicator with a slider
on Dec 28, 2017 at 6:52:25 am

Well I've managed to get the slider to control the Time Remapped movie in a comp which works great if you have the Time Indicator placed at the last frame. But if you move the time indicator it changes the effect of the slider.

And if you use this movie comp as a precomp in another comp then the Time indicator moves according to the Time indicator in the master comp and that changes the position of the Remap... which effects the relationship to the slider numbers.

I suspect I need some line of code that tells the slider expression to always start from frame 0 of the comp no matter where the time indicator is.

I have copied the expression I am using below. Any thoughts?

spd = thisComp.layer("MOVIE SLIDER").effect("Slider Control")("Slider")
n = spd.numKeys;
if (n > 0 && spd.key(1).time &lt; time){
accum = spd.key(1).value*(spd.key(1).time - inPoint);
for (i = 2; i &lt;= n; i++){
if (spd.key(i).time > time) break;
k1 = spd.key(i-1);
k2 = spd.key(i);
v2 = spd.valueAtTime(k2.time-.001);
accum += (k1.value + v2)*(k2.time - k1.time)/2;
}
accum += (spd.value + spd.key(i-1).value)*(time - spd.key(i-1).time)/2;
}else{
accum = spd.value*(time - inPoint);
}
accum/100


______________________

"Nothing is Easy"
Jethro Tull


Return to posts index

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