Return-Path: Received: from qmta15.emeryville.ca.mail.comcast.net ([76.96.27.228] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP id 4710303 for ae-list@media-motion.tv; Wed, 09 May 2012 18:36:54 +0200 Received: from omta17.emeryville.ca.mail.comcast.net ([76.96.30.73]) by qmta15.emeryville.ca.mail.comcast.net with comcast id 7rnR1j0041afHeLAFseVSe; Wed, 09 May 2012 16:38:29 +0000 Received: from HPZ200 ([76.20.32.7]) by omta17.emeryville.ca.mail.comcast.net with comcast id 7seU1j00Q09DSM08dseU4r; Wed, 09 May 2012 16:38:29 +0000 Message-ID: From: "Dan Ebberts" To: "After Effects Mail List" References: In-Reply-To: Subject: Re: [AE] Expressions: Decay after trigger Date: Wed, 9 May 2012 09:38:29 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0055_01CD2DC7.7D948680" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3538.513 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3538.513 This is a multi-part message in MIME format. ------=_NextPart_000_0055_01CD2DC7.7D948680 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable If there isn=E2=80=99t a direct relationship between distance and = opacity, you=E2=80=99re going to need a more complex expression. For = example, you may want to trigger a fade in when you get within a certain = distance and trigger a fade out (at a different rate) when it moves a = certain distance away. In that type of expression, you have to loop back = in time, frame-by-frame, to find the most recent triggering event. = It=E2=80=99s hard to say exactly what you need without more detail = though. Dan From: Byron Nash=20 Sent: Wednesday, May 09, 2012 7:42 AM To: After Effects Mail List=20 Subject: [AE] Expressions: Decay after trigger I am writing an expression to bring the opacity of a layer up when it = another layer comes close to it. I'd like to have it decay at a = different rate than it builds. Here's what I have going on:=20 o =3D transform.opacity; s =3D thisComp.layer("center").transform.scale[0]/100; //use the scale = to affect the radius of influence of the null l =3D length(transform.position, = thisComp.layer("center").transform.position); lprev =3D = length(transform.position.valueAtTime(time-thisComp.frameDuration), = thisComp.layer("center").transform.position.valueAtTime(time-thisComp.fra= meDuration)); if(lprev > l){ l =3D lprev; } o - (l/s); My attempt to look at the previous frame doesn't seem to be working. ------=_NextPart_000_0055_01CD2DC7.7D948680 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
If there isn=E2=80=99t a direct relationship between distance and = opacity, you=E2=80=99re=20 going to need a more complex expression. For example, you may want to = trigger a=20 fade in when you get within a certain distance and trigger a fade out = (at a=20 different rate) when it moves a certain distance away. In that type of=20 expression, you have to loop back in time, frame-by-frame, to find the = most=20 recent triggering event. It=E2=80=99s hard to say exactly what you need = without more=20 detail though.
 
Dan
 
From: Byron Nash
Sent: Wednesday, May 09, 2012 7:42 AM
Subject: [AE] Expressions: Decay after = trigger
 
I=20 am writing an expression to bring the opacity of a layer up when it = another=20 layer comes close to it. I'd like to have it decay at a different rate = than it=20 builds. Here's what I have going on:=20
 
o =3D = transform.opacity;
s =3D=20 thisComp.layer("center").transform.scale[0]/100; //use the scale to = affect the=20 radius of influence of the null
l =3D = length(transform.position,=20 thisComp.layer("center").transform.position);
lprev =3D=20 length(transform.position.valueAtTime(time-thisComp.frameDuration),=20 thisComp.layer("center").transform.position.valueAtTime(time-thisComp.fra= meDuration));
if(lprev > = l){
  l =3D = lprev;
}
o - (l/s);
 
 
My attempt to look at the previous frame doesn't seem to be = working.=20
------=_NextPart_000_0055_01CD2DC7.7D948680--