ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expressions Disabling Themselves

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mark Walczak
Expressions Disabling Themselves
on Mar 3, 2017 at 4:13:12 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!

http://vimeo.com/explosivegraffix


Return to posts index

Dan Ebberts
Re: Expressions Disabling Themselves
on Mar 3, 2017 at 4:49:27 pm

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

Dan



Return to posts index

Mark Walczak
Re: Expressions Disabling Themselves
on Mar 3, 2017 at 5:04:11 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){
n--;
}
}
if (n == 0){
t = 0;
}else{
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);
}else{
value;
}


http://vimeo.com/explosivegraffix


Return to posts index


Mark Walczak
Re: Expressions Disabling Themselves
on Mar 3, 2017 at 5:10:00 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.

http://vimeo.com/explosivegraffix


Return to posts index

Dan Ebberts
Re: Expressions Disabling Themselves
on Mar 3, 2017 at 5:13:48 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);


Dan



Return to posts index

Mark Walczak
Re: Expressions Disabling Themselves
on Mar 3, 2017 at 6:20:52 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,

http://vimeo.com/explosivegraffix


Return to posts index


Dan Ebberts
Re: Expressions Disabling Themselves
on Mar 3, 2017 at 6:50:11 pm

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

Dan



Return to posts index

Mark Walczak
Re: Expressions Disabling Themselves
on Mar 3, 2017 at 7:51:47 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,

http://vimeo.com/explosivegraffix


Return to posts index

Dan Ebberts
Re: Expressions Disabling Themselves
on Mar 4, 2017 at 5:28:34 pm

Thanks - I appreciate it!

Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]