Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions scaling a solid depending on the time

  • scaling a solid depending on the time

    Posted by Yair Neumann on January 18, 2011 at 12:02 pm

    Hello,

    I would like to scale a solid only on the Y axis when the time line/frames(doesn’t matter) reaches a certain number and than have it scale back.

    my final comp is to have a circle of solids scaling one after the other back and forth.

    this is what i have so far:

    thank your for your help

    scaleY=thisComp.layer("Null 1").effect("scaleY")("Slider");
    m = timeToFrames()%thisComp.layer("Null 1").effect("FRQ of scale")("Slider");
    maxscale = 40;
    minscale = 0;
    startFade = m;
    fadeDur = 1;

    if(m==index) {

    [value[0],value[1]+linear(m,startFade,startFade+fadeDur,maxscale,minscale)
    ];

    }

    else{

    [value[0],value[1]];

    };

    Dan Ebberts
    replied 15 years, 3 months ago
    2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    January 18, 2011 at 8:38 pm

    Play around with this:


    numLayers = 8; // number of layers participating
    cycleDur = 10; // total cycle duration
    scaleDur = 1; // time to scale up and down
    scaleMin = 0;
    scaleMax = 40;

    seg = Math.floor((time%cycleDur)/(cycleDur/numLayers));
    y = 0;
    if (seg == index-1){
    t = time%(cycleDur/numLayers);
    if (t < scaleDur/2)
    y = linear(t,0,scaleDur/2,scaleMin,scaleMax)
    else
    y = linear(t,scaleDur/2,scaleDur,scaleMax,scaleMin);
    }
    value + [0,y]

    Dan

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