Forum Replies Created

Page 1 of 2
  • Andres Torres

    May 21, 2015 at 4:54 pm in reply to: “Inertial Bounce” expression in text layer

    I agree..this expression is insanely useful!

    I’d like to alter the expression to begin with the last letter and end
    on the first letter.

  • Andres Torres

    September 2, 2013 at 9:42 pm in reply to: Inertial bounce with clamp

    I actually found a previous post. Does this seem logical (I added an amp factor with a slider)?

    // https://forums.creativecow.net/thread/227/18170

    freq = effect("Freq")("Slider");
    decay = effect("Decay")("Slider");

    n = 0;
    p = thisProperty

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

    if (n > 0){
    t = time - p.key(n).time;
    amp = p.velocityAtTime(p.key(n).time - .001)*effect("Amp")("Slider");

    w = freq*Math.PI*2;
    amp *= Math.floor(t*freq*2)%2 ? 1 : -1; value + amp* Math.sin(t*w)/Math.exp(decay*t)/w
    }else{
    value
    }

  • Andres Torres

    September 2, 2013 at 8:52 pm in reply to: Inertial bounce with clamp

    I’ve been trying this one from your site, but it behaves so different than my initial expression no matter how I play with my sliders for the variables. How would we keep my initial expression, but with a clamp on the second keyframe?

    e = .7;
    g = 5000;
    nMax = 9;

    n = 0;
    if (numKeys > 0){
    n = nearestKey(time).index;
    if (key(n).time > time) n--;
    }
    if (n > 0){
    t = time - key(n).time;
    v = -velocityAtTime(key(n).time - .001)*e;
    vl = length(v);
    if (value instanceof Array){
    vu = (vl > 0) ? normalize(v) : [0,0,0];
    }else{
    vu = (v < 0) ? -1 : 1;
    }
    tCur = 0;
    segDur = 2*vl/g;
    tNext = segDur;
    nb = 1; // number of bounces
    while (tNext < t && nb <= nMax){
    vl *= e;
    segDur *= e;
    tCur = tNext;
    tNext += segDur;
    nb++
    }
    if(nb <= nMax){
    delta = t - tCur;
    value + vu*delta*(vl - g*delta/2);
    }else{
    value
    }
    }else
    value

  • Andres Torres

    September 17, 2012 at 2:01 am in reply to: Oscilate y based on x velocity

    Works great, thanks.

  • Andres Torres

    September 16, 2012 at 10:16 pm in reply to: Keyframe Overshoot with no oscillation

    I keep getting this error with the expression when I change the freq and decay values.

    invalid numeric result (divide by zero?)

    Error occuredat line 13
    Property: ‘Position’

    I tried your suggested values and the position always returns to the last keyframed value. I’m looking to go past the keyframe and ease to a stop based on velocity and a friction variable.

    Thanks.

  • Andres Torres

    September 16, 2012 at 8:22 pm in reply to: Bounce y pos at each marker

    Thanks Dan, you’re amazing.

  • Andres Torres

    February 4, 2010 at 5:02 pm in reply to: Sum Marker Values

    So there’s 3 parts to this:

    1. A fade out that lasts for 20 frames that begins -10 frames from the marker (or 10 frames before the marker)

    2. hold the opacity at zero until 50 frames after the marker.

    3. A fade in that lasts for 20 frames and begins 50 frames after the marker.

    The expression below doesn’t exactly achieve this:

    startOutDown = -10; // frames from marker
    fadeOutFrames = 20; // duration of fade
    startFadeUp = 50 // frames from marker
    fadeUpFrames = 20; // duration of fade

    if (marker.numKeys > 0){
    t = marker.nearestKey(time).time;
    if (t > time){
    easeOut(time,t+startFadeOut+framesToTime(fadeOutFrames),t,100,0);
    }else{
    easeIn(time,t,t+startFadeUp+framesToTime(fadeUpFrames),0,100);
    }
    }else{
    value
    }

    This approach may be more robust:

    1. A fade out that lasts for 20 frames that begins -10 frames from the marker (or 10 frames before the marker)

    2. hold the opacity a specified number of frames, then begin a fade in that lasts for 20 frames.

  • Andres Torres

    February 4, 2010 at 3:12 pm in reply to: Sum Marker Values

    This is good. The only thing it’s missing is a fadeWidth variable to control how many frames to hold the opacity at zero.

  • Andres Torres

    February 4, 2010 at 3:00 am in reply to: Sum Marker Values

    I meant to be more specific…I should have specified the need to have control over when the fade-out begins and when the fade-in begins in relation to the marker. It will not be timed evenly on either side, i.e., the fade-out would probably begin more like 200 frames before the marker and the fade-in would begin about 60 frames after the marker.

    Thanks again,
    Andres

  • Andres Torres

    February 4, 2010 at 2:56 am in reply to: Sum Marker Values

    This expression worked flawlessly.

    I would like the markers to trigger an additional event. I need to have the opacity fade down about 30 frames before the marker and fade back up about 40 frames after the marker.

    I know the marker fades are traditionally measured by milliseconds, frames would be preferred if possible.

    -Andres

Page 1 of 2

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