Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Ease Expression

  • Posted by Jeff Mcbride on January 3, 2008 at 5:09 pm

    I’ve put together an expression to randomly scale a layer according to the value of a slider. My problem is that I can’t seem to get the scaling to ease- instead it acts like hold keyframes. Any suggestions?

    holdTime = .2;
    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+Scaler;

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

    Dan Ebberts replied 18 years, 4 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    January 3, 2008 at 5:27 pm

    You could ease it from one value to the next by adding some code to look ahead to the next seed, like this:

    holdTime = .2;
    seed = Math.floor(time/holdTime);
    t = time%holdTime;
    seedRandom(seed,true);
    oldMultiplier = random(1,8);
    seedRandom(seed+1,true);
    newMultiplier = random(1,8);
    multiplier = ease(t,0,holdTime,oldMultiplier,newMultiplier);
    Scaler = thisComp.layer(“Scale Shaker”).effect(“Slider Control”)(“Slider”);
    Shaker = transform.scale[0]+multiplier+Scaler;

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

    You could probably accomplish something very similar by using wiggle().

    Dan

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