Forum Replies Created

Page 43 of 1081
  • This is how I’d approach it, although it doesn’t have the sliders, or making the pause proportional to the height of the destination layer (it wouldn’t be hard to add those features):

    spd = 100;  // pixels per second
    pause = .5; // seconds
    startIndex = 2;
    endIndex = 5;
    curIndex = startIndex;
    accumTime = prevAccum = 0;
    while (accumTime <= time){
    curLayer = thisComp.layer(curIndex);
    curRect = curLayer.sourceRectAtTime(time,false);
    curPos = curLayer.toComp([curRect.left+curRect.width/2, curRect.top+curRect.height/2]);
    nextLayer = thisComp.layer(curIndex+1);
    nextRect = nextLayer.sourceRectAtTime(time,false);
    nextPos = nextLayer.toComp([nextRect.left+nextRect.width/2, nextRect.top+nextRect.height/2]);
    v = nextPos - curPos;
    dist = length(v);
    moveDur = dist/spd;
    totalDur = moveDur + pause;
    prevAccum = accumTime;
    accumTime += totalDur;
    curIndex++;
    if (curIndex >= endIndex) break;
    }
    delta = time - prevAccum;
    delta > moveDur ? nextPos : curPos + normalize(v)*ease(delta,0,moveDur,0,dist);
  • Dan Ebberts

    July 8, 2023 at 3:50 pm in reply to: Split text at irregular intervals

    I’m not sure exactly what you’re asking, but if you set your comp name up like this:

    “First_Second_Third”

    Then you could have expressions like this for your first line:

    s = thisComp.name.split("_");
    s[0]

    and this for your second line:

    s = thisComp.name.split("_");
    s[1] + " " + s[2]

    or, like this for your first line:

    s = thisComp.name.split("_");
    s[0] + " " + s[1]

    and this for your second line:

    s = thisComp.name.split("_");
    s[2]
  • Dan Ebberts

    July 6, 2023 at 9:56 pm in reply to: Linking properties between comps

    Generally, it should look like this:

    comp("Pre-comp").layer("Layer 1").position.valueAtTime(time - thisComp.layer("Pre-comp").startTime)
  • Dan Ebberts

    July 4, 2023 at 4:51 pm in reply to: Keyframes offset and duration expression

    It’s easy with linear keyframes, but it can get tricky if you have custom easing that has to be preserved. Depends on what you’re doing, exactly.

  • Dan Ebberts

    July 4, 2023 at 2:44 pm in reply to: Keyframes offset and duration expression

    Something like this should work:

    L = thisComp.layer(index-1);
    t1 = L.inPoint;
    t2 = L.outPoint;
    t = linear(time,t1,t2,key(1).time,key(2).time);
    valueAtTime(t)
  • This is probably not exactly what you’re looking for, but it might be close:

    letters = ["T","R","A","I","N","D","O","D","G","E"];
    holdTime = 1; // hold for 1 second
    seed = Math.floor(time/holdTime);
    seedRandom(seed,true);
    for (i = 0; i < letters.length; i++){
    idx = Math.floor(random(letters.length));
    temp = letters[i];
    letters[i] = letters[idx];
    letters[idx] = temp;
    }
    s = "";
    for (i = 0; i < letters.length; i++) s += letters[i];
    s
  • Dan Ebberts

    July 2, 2023 at 12:49 pm in reply to: After Effects Expression

    Expressions don’t have memory, so variables don’t survive from one frame to the next, but you can calulate your x value based on the current time, like this:

    var x = 0;
    var y = 2;
    var z = 10;
    x += Math.floor(time/y);
    x = Math.min(x,z);

    or elapsed time since the layer’s in point, like this:

    var x = 0;
    var y = 2;
    var z = 10;
    x += Math.floor((time-inPoint)/y);
    x = Math.min(x,z);
  • Assuming that upgrading to the latest version is not an option, I think you’re left with work-arounds, which could include scaling, or possibly a lot of different layers, each with its own font size, where they each get their source text from some input layer and each layer has an opacity expression to determine if it’s the visible one, based on a slider somewhere. Feasibility depends on your exact requirements…

  • Dan Ebberts

    June 19, 2023 at 6:12 pm in reply to: Set rove keyframes via script

    It works for me. It must be something in the way you have things set up.

  • Dan Ebberts

    June 17, 2023 at 7:26 pm in reply to: Changing the font style with Dropdown Menu Control

    Are you saying that you have expressions in your project that require the Legacy ExtendScript expression engine? If so, are there too many to just fix the expressions?

Page 43 of 1081

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