Skip to main content
MikeRod45
Participant
September 27, 2018
Question

Define video start time in expression

  • September 27, 2018
  • 1 reply
  • 719 views

I'm trying to make it so a video randomly plays back and forth using ease between a defined set of random time periods.

I have got this code I found and using and it works wonderfully, but It only works from the start of the video. I cannot tell it the starting frame or time to do it from.
After many hours of digging into expression help, trying to learn what I need I turned here for help.

Here is what I have so far:

start = 0;

end = 5;

seedRandom(index, true);

while (time > end) {

    rand = random(1, 9)

    start = end;

    end += rand;

}

maxVal = (end - start) / 2;

mid = (end + start) / 2;

if (time > mid)

  ease(time, mid + rand, end, maxVal, 0)

else

    ease(time, start, mid, 0, maxVal)

This topic has been closed for replies.

1 reply

angie_taylor
Legend
October 3, 2018

You could simplify it by doing this. Add some keyframes to your Time Remapping, make sure keyrame 2 is at the place where you want the randomness to start. I've used wiggle as it's simpler but you could use the same method with random and the ease expression. It s a little more complicated that way though.

k2 = key(2).time;

if (time<=k2) value;

else

wiggle(1, 10);