Forum Replies Created

Page 1 of 2
  • This is the final code I came up with, added by some help from ChatGPT.

    startKeyframe = 4;

    endKeyframe = 6;

    rangeDurationOut = key(endKeyframe).time – key(startKeyframe).time;

    if (time < key(startKeyframe).time) {

    // Play through keyframes from keyframe(1) until startKeyframe

    t = linear(time, inPoint, key(startKeyframe).time, key(1).time, key(startKeyframe).time);

    } else if (time < key(startKeyframe).time + rangeDurationOut) {

    // Pause at startKeyframe until rangeDurationOut is reached

    t = key(startKeyframe).time;

    } else {

    // Continue playing from startKeyframe until endKeyframe

    t = linear(time, outPoint – rangeDurationOut, outPoint, key(startKeyframe).time, key(endKeyframe).time);

    }

    valueAtTime(t);

  • Awesome, that worked! Well, sort of, because the expression ignores all keyframes that come before the specified keframes, but that is, because again, I did not specify my question particularly well. So what I need is for all keyframes before the specified keyframes to be played normally. But I do have an idea on how to achieve this :).

  • Let me try to clarify what I mean 🙂

    What I want is for AE to play through a number of keyframes defined by a starting and ending keyframe, but timeshifted to the outpoint of the layer. E. g. if I have 6 keyframes on a layer, from 0 secs to 5 secs, I’d like to play keyframes 4 to 6, but at the outpoint of the layer minus the time necessary to play through these keyframes.

  • At last, I did solve it myself and I realized that there were some errors in the original code I posted here, since I translated the “control for points” effect from german to english. I used point controls to circumvent the slider problem of going higher than 1 million and also to keep the effect controls to a minimum.
    Anyhow, here’s the final code:

    beginVal = effect(“Point Control”)(“Point”)[0];
    endVal = effect(“Point Control”)(“Point”)[1];
    startT = effect(“Point Control 2“)(“Point”)[0];
    endT = effect(“Point Control 2”)(“Point”)[1];
    decs = effect(“Slider Control”)(“slider”);

    t = ease(time,startT,endT,beginVal,endVal).toLocaleString(“de-DE” , {minimumFractionDigits: decs, maximumFractionDigits: decs});

    the “de-DE” stands for german formatting of numbers, but you can change that to whatever formatting you need. I’ve appended a link to stackoverflow.com where the most common ones are listed.

    —————————————————————————-
    https://stackoverflow.com/questions/3191664/list-of-all-locales-and-their-short-codes

  • Yeah, I figured out as much. Time Blend set to 100 % acts like sort of a permanent Echo. Still – insanely cool :).

  • Dude, your project feels like trying to read hieroglyphs without the rosetta stone to me :D. All I can glimpse is that it’s awesome! But this thing works without any plugin like Pastiche, correct?

  • Yeah, that’s pretty much what I’m trying to accomplish. I’ve already found a way, but I’d like to see if your way is better, if you’d like to share 🙂

  • Uh – interesting! I’ve never heard of Pastiche before, but that’s a spot on recommendation! Thanks a lot!

  • Sorry for my late reply! I think I can clear things up, once again, by providing you with a screenshot 🙂 .

  • So now, I’m stumped again. I’m working with the same project and wanted to adapt your expression to flip a CC composite effect from 0 % opacity to 100 %.There’s also an if clause that checks the layer’s y-position to see, if it’s been moved from a fixed position. If that is true, CC composite’s opacity is also turned on.

    I get an error message that “startTime” is not defined and might lie outside of the array’s valid space. But I think, that’s not all that is wrong here.

    Here’s the code:

    startTime = thisLayer.inPoint;

    truePos = thisComp.layer(“CONTROL_politicalParties”).transform.position[1];

    tag = “full”;

    t = 999999;

    for (i = 1; i <= thisComp.numLayers; i++){

    s = thisComp.layer(i).marker;

    if (s.numKeys > 0){

    n = s.nearestKey(time).index;

    if (time < s.key(n).time) n–;

    for (j = n; j > 0; j–){

    if (s.key(j).comment == tag){

    t = Math.min(t,time – s.key(j).time);

    break;

    }

    }

    }

    }

    if (t < startTime) {

    if (truePos == 757) {

    0;

    }else{

    100;

    }

    }

Page 1 of 2

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