Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expressions Disabling Themselves

  • Expressions Disabling Themselves

    Posted by Mark Walczak on March 3, 2017 at 4:13 pm

    Hi everyone,

    I’m working on a music project that involves a lot of expressions. I’d say there are about twenty attributes in my comp that are being linked via expressions. Many of those links are happening between Element and a positional reference Null. I have a scale bounce expression on that Null, and it often likes to disable itself, and several other expressions outside of that Null disable themselves. AE spits out different “can’t divide by zero” errors when they fault.

    I’ve grabbed ActivateDisabledExpressions from AEScripts, and it’s helping to move things along, but the expressions just re-disable themselves after about a minute of working.

    Has anyone run into this before? The main variable between this and other projects is Element, but I’m curious if anyone can offer a different solution.

    Thank you!

    Dan Ebberts
    replied 6 years, 12 months ago
    2 Members · 8 Replies
  • 8 Replies
  • Dan Ebberts

    March 3, 2017 at 4:49 pm

    Please post an example of one of the expressions that’s generating error messages.


  • Mark Walczak

    March 3, 2017 at 5:04 pm

    Hi Dan,

    Thank you so much for lending a hand.

    I’m using the inertial bounce expression below.

    I’ve used this dozens of times without issue. I’ve tried it on 2D solids, 3D nulls, parents of nulls, etc. I even just updated my graphics driver in case that was causing any issues, but alas, I’m stuck.

    Thank you so much for your help!

    // Inertial Bounce (moves settle into place after bouncing around a little)
    n = 0;
    if (numKeys > 0){
    n = nearestKey(time).index;
    if (key(n).time > time){
    if (n == 0){
    t = 0;
    t = time - key(n).time;

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

  • Mark Walczak

    March 3, 2017 at 5:10 pm

    Just to add more clarity, here is the error I get:

    After Effects warning: invalid numeric result (divide by zero?)
    Expression disabled.

    Error occurred at line 20.
    Comp: ‘Comp 1’
    Layer: 1 (‘Orange Solid 1’)
    Property: ‘Scale’

    This happened in a new project with one comp with one solid in it. I’m on Windows 10, CS6.

  • Dan Ebberts

    March 3, 2017 at 5:13 pm

    The Math.exp() will eventually overflow if too much time elapses after any particular keyframe. Try replacing this:

    t = time – key(n).time;

    with this:

    t = Math.min(time – key(n).time, 10);


  • Mark Walczak

    March 3, 2017 at 6:20 pm

    Hi Dan,

    Just an update:

    I can apply this expression to the scale of a Transform effect without issue, but it keeps error-ing out on my Null’s scale attribute. This is the line that continuously causes issues:

    value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);

    The scale value of the Transform effect has only one dimension, and is not an array like the 3D scale of my Null. Could that have something to do with it?

    Thanks again,

  • Dan Ebberts

    March 3, 2017 at 6:50 pm

    It should work with multi-dimensional properties. This is with the correction mentioned previously, correct?


  • Mark Walczak

    March 3, 2017 at 7:51 pm

    Hi Dan,

    Sorry for the confusion – I think our previous posts happened around the same time.

    I have to say that I’m cautiously optimistic, but I’m pretty sure you, like always, solved the problem.

    Can’t count the times you’ve helped me out of a bind. Check your tip jar – dinner’s on me tonight ☺

    Thank you so much,

  • Dan Ebberts

    March 4, 2017 at 5:28 pm

    Thanks – I appreciate it!


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