Return-Path: Received: from qmta08.emeryville.ca.mail.comcast.net ([76.96.30.80] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP id 5202255 for ae-list@media-motion.tv; Fri, 06 Sep 2013 18:40:48 +0200 Received: from omta10.emeryville.ca.mail.comcast.net ([76.96.30.28]) by qmta08.emeryville.ca.mail.comcast.net with comcast id Mrfj1m0040cQ2SLA8stVAT; Fri, 06 Sep 2013 16:53:29 +0000 Received: from HPZ200 ([76.20.32.7]) by omta10.emeryville.ca.mail.comcast.net with comcast id MstT1m00M09DSM08WstUBC; Fri, 06 Sep 2013 16:53:28 +0000 Message-ID: <2E3A2F47B9824589A8FC488F23C7E6CC@HPZ200> From: "Dan Ebberts" To: "After Effects Mail List" References: In-Reply-To: Subject: Re: [AE] Expression not working Date: Fri, 6 Sep 2013 09:53:29 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0051_01CEAAE6.F057F7E0" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3555.308 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1378486409; bh=HyEunKs/Uw/NYvr7UhjfO+To99Dm+h/6B1LJV/VJbgU=; h=Received:Received:Message-ID:From:To:Subject:Date:MIME-Version: Content-Type; b=ahJyZzTA33LhJ6HiVhmB6rPd7dXlaHSBz1ktXOIAd4jz96qqUGVKGmpTyNRnJSQyg fhyKwlvC31mfhvRCENX5t2nONWNFO9VAk6lA6zfMOn4MyeExYMqd5X5TBwuhxCl9Ji jGqRKiL34iCtBir5uT3mPmyMIsU3Xm8Q8kwFj2p1Ioq3YC4v2QR5yz3YzzrpkNc3Qu Qc2USIMkBhioJlsBBIN2Usar2rabz9tcuJCA8IgmFJvuJHBBSuYRa2Wj3jmYRiEOb9 8S1Oe9+rgzU4TxrVaL/CEzuAtdtRMVhBvUOOdoSk5MUrhGqeWlCSJpcpZulnVL5AxT 9/UzI/8KdB+rw== This is a multi-part message in MIME format. ------=_NextPart_000_0051_01CEAAE6.F057F7E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Try changing this line: if (n > 0){ to this: if ((n > 0) && (t < 10)){ Dan From: Martin, Chris (HQP)=20 Sent: Friday, September 06, 2013 9:46 AM To: After Effects Mail List=20 Subject: [AE] Expression not working In AE CS6, I get an error message when using this inertial bounce expression: amp =3D .04; freq =3D 5; decay =3D 5; n =3D 0; if (numKeys > 0){ n =3D nearestKey(time).index; if (key(n).time > time){ n--; }} if (n =3D=3D 0){ t =3D 0; }else{ t =3D time - key(n).time; } if (n > 0){ v =3D velocityAtTime(key(n).time - thisComp.frameDuration/10); value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t); }else{value} I am using this on two position keyframes. The funny thing is that I can preview/pre render it a few times and it works fine, then the error message comes up randomly and then the expression is broken. = What's also strange is that I am using the same expression on another = comp in the same project with not problems. Pulling my hair out! Any thoughts? Thanks! ------=_NextPart_000_0051_01CEAAE6.F057F7E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Try changing this line:
 
if (n > 0){
 
to this:
 
if ((n > 0) && (t < 10)){
 
 
 
Dan
 
Sent: Friday, September 06, 2013 9:46 AM
Subject: [AE] Expression not working
 
In AE CS6, = I get an=20 error message when using this inertial
bounce=20 expression:
 
amp =3D = .04;
freq =3D = 5;
decay =3D = 5;
n =3D = 0;
if (numKeys = >=20 0){
n =3D=20 nearestKey(time).index;
if = (key(n).time >=20 time){
n--;
}}
if (n = =3D=3D 0){ t =3D=20 0;
}else{
t =3D time = -=20 key(n).time;
}
if (n > = 0){
v =3D=20 velocityAtTime(key(n).time - thisComp.frameDuration/10);
value +=20 v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{value}
 
I am using = this on=20 two position keyframes. The funny thing is that I can
preview/pre = render it=20 a few times and it works fine, then the
error = message comes=20 up randomly and then the expression is broken. What's also strange is = that I am=20 using the same expression on another comp in the same project with not = problems.=20 Pulling my hair out!
 
Any = thoughts?=20 Thanks!
 
------=_NextPart_000_0051_01CEAAE6.F057F7E0--