Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Random placement at frame markers

  • Random placement at frame markers

    Posted by Stu Pond on October 17, 2006 at 7:21 pm

    Hello folks,

    I’m sure this is old hat, but I have a job where I have to place 4-5 type elements randomly across the page at certain intervals.

    What I’m wondering is how easy is it for me to create an expression that (for each layer I apply it to):

    a) Generates a random letter in a type layer

    b) Rotates, scales and places the layer randomly on the page

    c) fades out the layer using opacity then . . .

    d) starts again, either within an adjustable time range (say 10-15 seconds) or when it approaches a layer marker.

    I’m not so cheeky as to ask anyone to write me this expression, but is it a quick and simple job or should I just forget the whole thing and create a series of routines manually.

    Cheers,

    stigWeard

    Stu Pond replied 19 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Mike Clasby

    October 17, 2006 at 11:22 pm

    For random Text, every 10 sec, with the text tool make a character (any character), then this expression on Source Text:

    holdTime = 10; //time to hold each character (seconds)

    seed = Math.floor(time/holdTime);
    seedRandom(seed,true);

    s = “”;
    c = Math.floor(random(65,91));
    s += String.fromCharCode(c);
    s

    The 65 to 91 covers the letters in the alphabet, lower numbers brings in the numbers and other symbols.

    ———————————————————

    For random position, every 10 sec, limited to comp width and height:

    holdTime = 10; //time to hold each position (seconds)

    seed = Math.floor(time/holdTime);
    seedRandom(seed,true);
    random([thisComp.width, thisComp.height])

    ——————————————————

    For random rotation, every 10 sec:

    holdTime = 10; //time to hold each rotation (seconds)

    seed = Math.floor(time/holdTime);
    seedRandom(seed,true);
    random(0,360)

    ——————————

    For Scale, set an initial keyframe at “0”, then add this expression:

    holdTime = 10; //time to hold each scale (seconds)

    seed = Math.floor(time/holdTime);
    seedRandom(seed,true);
    s = random(30,100)
    value +[ s,s]

    This is set to have scale from 30 to 100% (change the (30,100) in the random line)Hey, I know this is a hacked deal, there is an expression without the “value +” and hence no initial keyframe at 0, but I couldn’t noodle it out.
    ———————————–

    For opacity, (another hack, hold your nose, please), set keyframes for opacity, like 0% at 0 sec, then 100% at 8 sec then 0 % at 10 sec, then add this loop expression:

    loopOut(“cycle”, 0)

    ————————————–

    Note: all the hold times need to be the same, you might want to tie them to a Slider to make change easy. If you change the holdTime, then slide the opacity keyframes to match the hold time.

    These were hacked from Dan Ebberts. Also, like I said, scale and Opacity are not the cleanest expressions, I’m sure there are better ones out there, maybe someone will supply better ones, I hope. But this works, set up one letter, then just dup the layer as many times as you want letters to be on the screen.

  • Stu Pond

    October 18, 2006 at 9:52 am

    That’s superb. I’ll implement the scripts in the comp and see how it goes.

    Thanks for your help with this – I used to programme Director at a intermediate level years and years ago so will have a look at these scripts to see if I can work out how they work.

    Cheers,

    stigWeard

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy