Forum Replies Created

Page 18 of 1081
  • It would help if you could describe what’s generating the animation and what you want to happen.

  • Dan Ebberts

    August 18, 2024 at 2:29 pm in reply to: overshoot expression bug

    >the expression is from motion script site

    Not exactly.

    One thing I notice is that you have the frequency tied to a slider. Is the slider animated at all? That could cause problems.

  • Dan Ebberts

    August 18, 2024 at 12:34 am in reply to: AE Amplitude Expression ease timing

    It will probably look something like this:

    // count previous beats
    threshold = 10.0;
    moveAmt = [0,-10];
    audioLev = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
    above = false;
    frame = timeToFrames(time);
    n = 0;
    fSave = 0;
    while (frame >= 0){
    t = framesToTime(frame);
    if (above){
    if (audioLev.valueAtTime(t) < threshold){
    above = false;
    }
    }else if (audioLev.valueAtTime(t) >= threshold){
    if (fSave == 0) fSave = frame;
    above = true;
    n++;
    }
    frame--
    }
    // find the next beat
    frame = Math.round(time / thisComp.frameDuration) + 1;
    above = audioLev.value > threshold
    while(framesToTime(frame) < thisComp.duration){
    t = framesToTime(frame);
    if (above){
    if (audioLev.valueAtTime(t) < threshold){
    above = false;
    }
    }else if (audioLev.valueAtTime(t) >= threshold){
    break;
    }
    frame++;
    }
    dt = time - framesToTime(fSave);
    tTot = framesToTime(frame - fSave);
    value + n*moveAmt + linear(dt,0,tTot,[0,0],moveAmt)
  • Dan Ebberts

    August 16, 2024 at 5:31 pm in reply to: Wiggle only positive values two dimensions

    Depending on how you want it to behave, this would be one way:

    w = wiggle(3,.02);
    d = w - value;
    value + [Math.abs(d[0]),Math.abs(d[1])]
  • toWorld() has a built-in time parameter. Try it this way:

    delay = 3; // delay frames
    L = thisComp.layer("Null_1");
    L.toWorld(L.anchorPoint,time - delay*thisComp.frameDuration)
  • >Also, new to these forums, how do I post script properly?

    Paste your code into your response, then click the Aa button below your post, then select your code and click the </> button.

  • Dan Ebberts

    August 14, 2024 at 7:39 pm in reply to: Evenly distributing editable text layers horizontally

    No, it’s a position expression.

  • Dan Ebberts

    August 14, 2024 at 7:32 pm in reply to: Evenly distributing editable text layers horizontally

    I’m making a lot of assumptions here, but it might be helpful. I’m only considering the text layers themselves, I’m assuming there are 4 of them and that they are layers 1 thru 4 in the layer stack. I’m assuming the the margins at the edges of the comp will be half the spacing between the text layers. With that in mind, I think this position expression will space your text layers in the x direction:

    n = 4; // number of text layers participating
    // get total text width for all layers
    w = 0;
    for (i = 1; i <= n; i++){
    w += thisComp.layer(i).sourceRectAtTime(time).width;
    }
    // calcuate extra space
    s = thisComp.width - w;
    gap = s/n; // gap between text layers
    margin = gap/2
    // calculate where my left edge should be
    myLeftEdge = margin;
    for (i = 1; i < index; i++){
    myLeftEdge += thisComp.layer(i).sourceRectAtTime(time).width + gap;
    }
    // move this layer into position
    [myLeftEdge - sourceRectAtTime(time).left, value[1]]
  • I think this will just pick up the style attributes you mentioned from Text Layer 1 and leave the rest untouched:

    txt = thisComp.layer("Text Layer 1").text.sourceText;
    s = txt.style;
    thisProperty.style.setFont(s.font).setFontSize(s.fontSize).setText(txt).setLeading(s.leading).setTracking(s.tracking);
  • My guess is it would look something like this:

    txt = thisComp.layer("times").text.sourceText;
    splt = txt.split("\r");
    n = splt.length;
    t = 0; i = n-1;
    function getTime(x){return(parseFloat(splt[x].split("/")[1]))}
    while(i >= 0){
    if (time >= getTime(i)){
    t = time - getTime(i)
    break;
    }
    i--;
    }
    valueAtTime(t);
Page 18 of 1081

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