Return-Path: Received: from qmta10.emeryville.ca.mail.comcast.net ([76.96.30.17] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP id 5228707 for ae-list@media-motion.tv; Thu, 26 Sep 2013 05:16:59 +0200 Received: from omta20.emeryville.ca.mail.comcast.net ([76.96.30.87]) by qmta10.emeryville.ca.mail.comcast.net with comcast id Ve7N1m0031smiN4AAfHADo; Thu, 26 Sep 2013 03:17:10 +0000 Received: from sz0031.ev.mail.comcast.net ([76.96.40.137]) by omta20.emeryville.ca.mail.comcast.net with comcast id VfH91m0082xZMJ48gfH9Pk; Thu, 26 Sep 2013 03:17:09 +0000 Date: Thu, 26 Sep 2013 03:17:08 +0000 (UTC) From: Dan Ebberts To: After Effects Mail List Message-ID: <390848939.1539023.1380165428403.JavaMail.root@sz0031a.emeryville.ca.mail.comcast.net> In-Reply-To: Subject: Re: [AE] Inertial bounce expression keeps being disabled randomly... MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1539022_2036855338.1380165428398" X-Originating-IP: [::ffff:50.149.72.217] X-Mailer: Zimbra 6.0.13_GA_2944 (ZimbraWebClient - FF3.0 (Win)/6.0.13_GA_2944) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1380165430; bh=02IVEUhUwKD/SkhVmFh7ya0qciRLWCLPM45OdgxRNXU=; h=Received:Received:Date:From:To:Message-ID:Subject:MIME-Version: Content-Type; b=G+r2h3v+Yo1m45WlUeBqAlEf09LWfbw7lsvxwtbiYhpRqHrt6k4+re8xpns+J/aUv wfiY3Y6ySskMJcyplhHgwbyx3yEuOGBKUGJAMPYLL5xDQC0C5fsPN+IUE5YrlbP5qq OR2eGcEjJT9/mYB/kfJ/Fxh4yM7k2cdf31TqAQjvy7zaCto5xYz8RA36fZzv9TD74O cT9kc5F3AwuFA1OKNXgjPqBTz4zaJtxVyLq75y1/Gcy50rOBmY+ZlBKz41sFeO7FZ7 rmoTtHBC+vyQVfVQVHtrvGgyqQDZmPxs2Qjd1XxsG3jUDp3jhRRvEdUJ4YJHzjua55 2n6H6nP+J3JYg== ------=_Part_1539022_2036855338.1380165428398 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Limiting the value of t should solve the problem: t = Math.min(time - key(n).time,10); Dan ----- Original Message ----- From: "D" To: "After Effects Mail List" Sent: Wednesday, September 25, 2013 8:38:51 AM Subject: Re: [AE] Inertial bounce expression keeps being disabled randomly... Line 12, same line as the other version of the expression (which was line 10). On 25 September 2013 16:34, Lloyd Alvarez < lists@aescripts.com > wrote: What line number are you getting the error on? On Wed, Sep 25, 2013 at 11:30 AM, D < dow.hanson@gmail.com > wrote:
Looks good. I'll try and persuade these guys to buy that script. Also, I've just had more expression failures but still get the divide by zero error when I try to paste your solution above. Is this a bug beyond the expression? On 25 September 2013 15:40, Lloyd Alvarez < lists@aescripts.com > wrote:
You can use this to batch update all the expressions in your project: http://aescripts.com/pt_expressedit/ On Wed, Sep 25, 2013 at 9:46 AM, D < dow.hanson@gmail.com > wrote:
Yes, was guessing that. Too many instances to replace with an upcoming deadline though so quick fixing with the aid of your script for now. On 25 September 2013 14:35, Lloyd Alvarez < lists@aescripts.com > wrote:
The expression will keep failing unless you account for that divide by zero error. On Wed, Sep 25, 2013 at 9:23 AM, D < dow.hanson@gmail.com > wrote:
Thanks Lloyd. Funnily enough, I just found your script 'Activate Disabled Expressions'. I purged all memory then applied the script. Emptying the memory seems to allow them back on. Great script. Next time I get a mass disablement I'll try your solution. On 25 September 2013 12:35, Lloyd Alvarez < lists@aescripts.com > wrote:
As the error suggests, it gets disabled because it tries to divide by zero.. Most probably because you are in negative time due to this: t = time - key(n).time; You can protect against that in several ways but here's a quick cheeky way: amp = .1; freq = 2.0; decay = 12.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); d= Math.exp(decay*t); if ( d == 0 ) d= 0.0001; value + v*amp*Math.sin(freq*t*2*Math.PI)/d; }else{value} Cheers, Lloyd On Wednesday, September 25, 2013, D wrote:
...confusingly, the expression will sometimes continue to work on other layers in the same comp on both position and scale parameters whilst some get disabled. On 25 September 2013 10:40, D < dow.hanson@gmail.com > wrote:
Hi The expression I'm using looks like this: amp = .1; freq = 2.0; decay = 12.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} It works most of the time then will randomly get disabled across lots of layers and will not allow me to re-enable until I've restarted AE (v5.5). This is the error: -- After Effects warning: invalid numeric result (divide by zero?) Expression disabled. Error occurred at line 10. Comp: 'XXX' Layer 17 ('XXX') Property: 'Scale' -- I have no real knowledge of how expression code works. I cut and paste when I use them. The project is 4 minutes long and the expression occurs across many comps and typically as the deadline approaches the error is now cropping up often. Any help appreciated. Thanks.
------=_Part_1539022_2036855338.1380165428398 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit
Limiting the value of t should solve the problem:

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

Dan


From: "D" <dow.hanson@gmail.com>
To: "After Effects Mail List" <AE-List@media-motion.tv>
Sent: Wednesday, September 25, 2013 8:38:51 AM
Subject: Re: [AE] Inertial bounce expression keeps being disabled randomly...

Line 12, same line as the other version of the expression (which was line 10).


On 25 September 2013 16:34, Lloyd Alvarez <lists@aescripts.com> wrote:
What line number are you getting the error on?


On Wed, Sep 25, 2013 at 11:30 AM, D <dow.hanson@gmail.com> wrote:
Looks good. I'll try and persuade these guys to buy that script. Also, I've just had more expression failures but still get the divide by zero error when I try to paste your solution above. Is this a bug beyond the expression? 


On 25 September 2013 15:40, Lloyd Alvarez <lists@aescripts.com> wrote:
You can use this to batch update all the expressions in your project: http://aescripts.com/pt_expressedit/


On Wed, Sep 25, 2013 at 9:46 AM, D <dow.hanson@gmail.com> wrote:
Yes, was guessing that. Too many instances to replace with an upcoming deadline though so quick fixing with the aid of your script for now. 


On 25 September 2013 14:35, Lloyd Alvarez <lists@aescripts.com> wrote:
The expression will keep failing unless you account for that divide by zero error.


On Wed, Sep 25, 2013 at 9:23 AM, D <dow.hanson@gmail.com> wrote:
Thanks Lloyd. Funnily enough, I just found your script 'Activate Disabled Expressions'. I purged all memory then applied the script. Emptying the memory seems to allow them back on. Great script. Next time I get a mass disablement I'll try your solution.


On 25 September 2013 12:35, Lloyd Alvarez <lists@aescripts.com> wrote:
As the error suggests, it gets disabled because it tries to divide by zero.. Most probably because you are in negative time due to this: t = time - key(n).time;

You can protect against that in several ways but here's a quick cheeky way:

amp = .1;

freq = 2.0;

decay = 12.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);

d= Math.exp(decay*t);
if ( d == 0 ) d= 0.0001;

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

}else{value}


Cheers,

Lloyd

On Wednesday, September 25, 2013, D wrote:
...confusingly, the expression will sometimes continue to work on other layers in the same comp on both position and scale parameters whilst some get disabled. 


On 25 September 2013 10:40, D <dow.hanson@gmail.com> wrote:
Hi

The expression I'm using looks like this:

amp = .1;

freq = 2.0;

decay = 12.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}


It works most of the time then will randomly get disabled across lots of layers and will not allow me to re-enable until I've restarted AE (v5.5). This is the error:


--


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

Expression disabled.


Error occurred at line 10.

Comp: 'XXX'

Layer 17 ('XXX')

Property: 'Scale'


--


I have no real knowledge of how expression code works. I cut and paste when I use them. The project is 4 minutes long and the expression occurs across many comps and typically as the deadline approaches the error is now cropping up often. Any help appreciated.


Thanks.









------=_Part_1539022_2036855338.1380165428398--