Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Random Scale Expression

  • Random Scale Expression

    Posted by Jeff Mcbride on January 1, 2008 at 10:28 pm

    Hey guys- I’m trying to craft an expression that will allow me to wiggle the scale of each layer independently of all the other layers but all connected to the same slider control. I also need the keyframed scale values to remain for each layer. I’ve tried a dozen different methods but can’t seem to get it right.

    Ultimately each scale will equal itself + a random number (which has a Max value determined by the slider) I can get that far- but I can’t seem to get the random number to occur only every 8 frames or so. Any suggestions? Thanks!

    Ross Gerbasi replied 18 years, 4 months ago 2 Members · 4 Replies
  • 4 Replies
  • Jeff Mcbride

    January 2, 2008 at 5:43 pm

    So I came up with this script which does everything I need except it scales as if I used Hold keyframes- any way to interpolate between time? Thanks!

    holdTime = .2; //time to hold each position (seconds)
    seed = Math.floor(time/holdTime);
    seedRandom(seed,true);
    multiplier = random(1,8);
    Scaler = thisComp.layer(“Scale Shaker”).effect(“Slider Control”)(“Slider”);
    Shaker = transform.scale[0]+multiplier;

    if (Scaler > 0){
    [Shaker,Shaker];
    }else {[value[0],value[1]];}

  • Ross Gerbasi

    January 2, 2008 at 6:31 pm

    sumthing like this?

    holdTime = .2; //time to hold each position (seconds)
    var current_time = time% holdTime;

    seed = Math.floor(time/holdTime);
    seedRandom(seed,true);
    multiplier = random(1,-20);
    if(current_time < holdTime/2){ amount =transform.scale[0]+ linear(current_time, 0, holdTime/2, 0, multiplier); }else{ amount =transform.scale[0]+ linear(current_time, holdTime/2, holdTime, multiplier, 0); } [amount ,amount ]; -ross

  • Jeff Mcbride

    January 3, 2008 at 4:27 pm

    That gives me the scaling I need but the scaling still takes place when the slider equals 0 which it should not.

  • Ross Gerbasi

    January 3, 2008 at 9:58 pm

    oh yeah forgot there was a slider… here ya go

    var slider_val = effect(“Slider Control”)(“Slider”)

    if(slider_val != 0){
    holdTime = .2; //time to hold each position (seconds)
    var current_time = time% holdTime;
    seed = Math.floor(time/holdTime);
    seedRandom(seed,true);
    multiplier = random(0,slider_val );
    if(current_time < holdTime/2){ amount =transform.scale[0]+ linear(current_time, 0, holdTime/2, 0, multiplier); }else{ amount =transform.scale[0]+ linear(current_time, holdTime/2, holdTime, multiplier, 0); } [amount ,amount ]; }else{ [value[0], value[1]] } -ross

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