Forum Replies Created

Page 137 of 1081
  • wiggle() always includes the value of the property, so try changing this:

    lev = wiggle(0.5,linear(effect(“MONITOR A LEVITATE”)(“Slider”),0,100,0,3))

    to this:

    lev = wiggle(0.5,linear(effect(“MONITOR A LEVITATE”)(“Slider”),0,100,0,3)) – value;

    Dan

  • Dan Ebberts

    July 11, 2020 at 5:55 am in reply to: How to randomly change color of characters

    Just change the Expression Selector’s Based On parameter to Words.

    Dan

  • Dan Ebberts

    July 7, 2020 at 11:08 pm in reply to: using “.length” on a csv field

    Hard to say without seeing your data file, but is it possible that those values are already numbers, and not strings? If so, maybe this would work:

    M = (mon < 10 ? “0” : “”) + mon;

    Dan

  • Dan Ebberts

    July 6, 2020 at 3:36 pm in reply to: set slider number to layer marker

    Like this maybe:


    n = 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (time < marker.key(n).time) n--;
    }
    n

    Dan

  • Dan Ebberts

    July 4, 2020 at 6:27 am in reply to: FX Expression for Days Hours Min Sec Countdown?

    It might have to do with how you have the time formatted, but I can’t tell from your screenshot.

    Dan

  • Dan Ebberts

    July 3, 2020 at 11:54 pm in reply to: FX Expression for Days Hours Min Sec Countdown?

    I’m not sure what you’re after exactly, but this example would drive the Trim Paths End value from 100 to 0 as the seconds count down. Probably some form of this would do what you want:

    t = thisComp.layer(“time”).text.sourceText.value;
    sec = parseInt(t.split(” “)[3],10);
    linear(sec,0,60,0,100)

    Dan

  • Dan Ebberts

    July 1, 2020 at 3:29 pm in reply to: Center an Object based on Alpha

    You certainly could modify the expression to find the extents in the vertical directions as well, but this technique is so inefficient that I’m having trouble imagining why anyone would want to do that now that sourceRectAtTime() is available. The expression is slow because it starts at the left edge of the comp and samples a one-pixel-wide by comp-height rectangle at every pixel location from left to right until it finds one with non-zero alpha. Then it does the same thing starting from the right edge, moving left. That eats up a lot of horsepower. sourceRectAtTime() is so much better.

    Dan

  • Dan Ebberts

    June 30, 2020 at 12:47 pm in reply to: Continuous bounce

    This is slightly better:


    freq = 0.5;
    decay = 1;
    val = value
    n = 0;
    if (numKeys > 0){
    n = nearestKey(time).index;
    if (key(n).time > time) n--;
    }
    if (n > 1){
    w = freq*Math.PI*2;
    for (i = 2; i <= n; i++){
    t = time - key(i).time;
    if (t > 10/decay) continue;
    amp = velocityAtTime(key(i).time - .001);
    val += amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
    }
    }
    val

    Dan

  • Dan Ebberts

    June 30, 2020 at 6:32 am in reply to: Continuous bounce

    See what this version does for you:


    freq = 0.5;
    decay = 1;
    val = value
    n = 0;
    if (numKeys > 0){
    n = nearestKey(time).index;
    if (key(n).time > time) n--;
    }
    if (n > 1){
    amp = velocityAtTime(key(n).time - .001);
    w = freq*Math.PI*2;
    for (i = 2; i <= n; i++){
    t = Math.min(time - key(i).time,10/decay);
    amp = velocityAtTime(key(i).time - .001);
    val += amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
    }
    }
    val

    Dan

  • The trick is that your code has to count how many events have occurred prior to the current time. If you’re monitoring a value, you can use the brute-force technique described here:

    https://motionscript.com/design-guide/audio-count.html

    If there are keyframes or markers associated with the events it becomes much simpler.

    Dan

Page 137 of 1081

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