Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions GrayMachineScript Error – CS6

  • GrayMachineScript Error – CS6

    Posted by Eric Guiliani on August 20, 2013 at 6:54 pm

    Hey all,

    So I’m using the latest version of CS6, and I tried using graymachine’s “super awesome presets”… inparticular the “inertial bounce” expression. I initially can add it to the position attribute of a layer, but after it code checks, I get an error:

    invalid numeric result (divide by zero?) Error occurred at line 19.
    Comp: ‘compName’+ _logo layered’
    Layer: 1(‘ae’)
    Property: ‘Position’

    Any ideas what this means? initially it seems to work, but then gets error’d out.

    amp = .1;
    freq = 2.0;
    decay = 2.0;

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

    if (n == 0){ t = 0;
    }else{
    t = time - key(n).time;
    }

    if (n > 0){
    v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
    value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
    }else{value}

    Eric Guiliani replied 12 years, 11 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    August 20, 2013 at 7:34 pm

    Long comp? I’m guessing it’s the same issue as this thread:

    https://forums.creativecow.net/readpost/227/24967

    Dan

  • Eric Guiliani

    August 20, 2013 at 7:43 pm

    Thanks so much, that did it. Any idea why this would break in CS6 and how come its never been noted with such a popular expression library such as this?

  • Dan Ebberts

    August 20, 2013 at 8:44 pm

    I don’t think it’s related to which version of AE you’re using. It happens when your comp is long enough for Math.exp(decay*t) to evaluate to the JavScript equivalent of INFINITY, which in your case, with decay = 2, would occur about six minutes after the last keyframe. So not everyone will see this problem. Just curious–how long is your comp?

    With older versions of AE, it may be that there was never any reason to calculate the expression that far out if you didn’t look at it with the Graph Editor or render out that far. Maybe the newer look-ahead caching behavior is just flushing out the expression’s limitations.

    Dan

  • Eric Guiliani

    August 20, 2013 at 9:21 pm

    Ah. It was 10 minutes long. Bingo. I shortened to 30 seconds and it worked. So I guess this needs to be kept in mind when you’re working in a long comp.

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