ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Randomize scale, position and time... everything sincronized

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Daniel Daun
Randomize scale, position and time... everything sincronized
on Nov 19, 2016 at 10:43:20 pm

Hi, I'm new to expression but I'm triying to get a video that jump cuts in time (always forward), and everytime it jump cuts it has a new randomized scale and position.

So I need not to see the frame going to the new scale, position, but as with time, to skip to it.

I red everything I could find:

starting by this jumpcut code found here:

minCut = .5;
maxCut = 1;
minDur = 0.3;
maxDur = 0.7;

tStart = tEnd = 0;
startVal = endVal = 0;
dur = cut = 0;
seedRandom(index, true);
while (time >= tEnd){
dur = random(minDur, maxDur);
cut = random(minCut, maxCut);
tStart = tEnd;
startVal = endVal;
tEnd += dur;
endVal += dur + cut;
}
linear(time, tStart, tEnd, startVal, startVal + dur);

and then triying to make it works with some stuff from:

http://www.motionscript.com/mastering-expressions/random-1.html

The problem is that expressions from there are based on holdTime, and the jump cut above is on two variables (max and mix Dur)
so I really don't know how to make them work togheter...

I also found...

https://forums.creativecow.net/thread/227/31385

in the code given by Dan Ebberts it leaves the transitioning part (but I think that just changing linear to random could
be enough) but seems to have no linking to the jumpcut,
as I understand, his script work on syncronizing tStart and tEnd, but in the jumpcode code above tStart and tEnd are = 0 and if I try
to link them to PointControl (as I see he does on Scale, Position etc... I know it makes no sense but just trying) doesn't work...

Basically, how would be a jumpcut (always forward) time code based on the PointControl on the code wrote there...

the best thing I came up with is this:
I tried to create a random slider and could convert Dan Ebbert code to holdingTime,
making the slider define every attributes' holding time and then I used
, it seems to me that it should be working but the time code starts
bugging and goes very fast and backwards too (it should be going only forward...)

As the moment i'm using a hardcoded holdingTime and it works, everything is in sync, but I need it to be random...


really need to find a solution...

Thanks,
I know is much but is really important.


Return to posts index

Dan Ebberts
Re: Randomize scale, position and time... everything sincronized
on Nov 20, 2016 at 2:05:37 am

Does the time between the cuts need to be random, or can it periodic?


Dan



Return to posts index

Daniel Daun
Re: Randomize scale, position and time... everything sincronized
on Nov 20, 2016 at 2:50:45 pm

As periodic you mean a fixed interval? I'm actually working with holdTime set at 2 seconds, but the real bomb would be a random number (working like from 0.5 to 5)...

thanks for your help.


Return to posts index


Dan Ebberts
Re: Randomize scale, position and time... everything sincronized
on Nov 20, 2016 at 5:30:13 pm

This should get you headed in the right direction. Add a slider control to your time-remapped clip and add this expression to the slider:


minCut = .5;
maxCut = 1;
minDur = 0.5;
maxDur = 5;

tStart = tEnd = tOffset = 0;
dur = cut = 0;
seedRandom(index, true);
while (time >= tEnd){
dur = random(minDur, maxDur);
cut = random(minCut, maxCut);
tStart = tEnd;
tEnd = tStart + dur;
tOffset += cut
}
tOffset


Add this time remapping expression:

tOffset = effect("Slider Control")("Slider");
time + tOffset

Something like this for postion:

tOffset = effect("Slider Control")("Slider");
minPos = [width*scale[0]/200,height*scale[1]/200];
maxPos = [thisComp.width,thisComp.height] - minPos;
seedRandom(tOffset,true);
random(minPos,maxPos)

and something like this for scale:

tOffset = effect("Slider Control")("Slider");
minScale = 50;
maxScale = 150;
seedRandom(tOffset,true);
s = random(minScale,maxScale);
[s,s]


Dan



Return to posts index

Daniel Daun
Re: Randomize scale, position and time... everything sincronized
on Nov 20, 2016 at 8:31:15 pm

It seems to work just fine!

thanks a lot!
good karma


Return to posts index

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