ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Random Jump Cuts based on time markers

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Rolando Lacanna
Random Jump Cuts based on time markers
on Aug 24, 2016 at 8:43:19 am

Hello
I'm trying to edit this expression:

segDur = .5;// duration of each "segment" of random time
minVal = inPoint;
maxVal = outPoint - segDur;

seed = Math.floor(time/segDur);
segStart = seed*segDur;
seedRandom(seed,true);
startVal = random(minVal,maxVal);
endVal = startVal + segDur;
linear(time,segStart,segStart + segDur, startVal, endVal);

To make the jump cuts start and end based on time markers, but with no luck :(
Anyone has suggestions?
Many thanks in advance

segDur = .5;// duration of each "segment" of random time
minVal = inPoint;
maxVal = outPoint - segDur;

seed = Math.floor(time/segDur);
segStart = seed*segDur;
seedRandom(seed,true);
startVal = random(minVal,maxVal);
endVal = startVal + segDur;
linear(time,segStart,segStart + segDur, startVal, endVal);


Return to posts index

Dan Ebberts
Re: Random Jump Cuts based on time markers
on Aug 24, 2016 at 4:42:38 pm

I guess it would be something like this:


minVal = inPoint;
maxVal = outPoint;
n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) n--;
}
if (n > 0){
t = time - marker.key(n).time;
seedRandom(n,true);
base = random(minVal,maxVal);
base + t;
}else
value


but you'll probably want to adjust maxVal so it never runs off the end of the clip.

Dan



Return to posts index

Rolando Lacanna
Re: Random Jump Cuts based on time markers
on Aug 24, 2016 at 8:54:26 pm

That's exactly what I was looking for!
Thank you so much!!!


Return to posts index


Peter Zeet
Re: Random Jump Cuts based on time markers
on Jan 29, 2020 at 6:14:14 pm

hi!
I've been trying to adapt it to make the jump go to the frame number on each marker's comment instead of random (so if the marker comment says 17, it jumps to frame 17, etc), but no luck at all
Any ideas? Thanks!


Return to posts index

Dan Ebberts
Re: Random Jump Cuts based on time markers
on Jan 29, 2020 at 6:56:01 pm

Try this:


n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) n--;
}
if (n > 0){
time - marker.key(n).time + framesToTime(parseInt(marker.key(n).comment,10));
}else
0



Dan



Return to posts index

Peter Zeet
Re: Random Jump Cuts based on time markers
on Jan 30, 2020 at 3:33:30 pm

thanks!! what a beautiful line of code!


Return to posts index

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