Return-Path: Received: from qmta06.emeryville.ca.mail.comcast.net ([76.96.30.56] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP id 5274844 for ae-list@media-motion.tv; Tue, 05 Nov 2013 04:07:44 +0100 Received: from omta11.emeryville.ca.mail.comcast.net ([76.96.30.36]) by qmta06.emeryville.ca.mail.comcast.net with comcast id ledm1m0030mlR8UA6f9EMH; Tue, 05 Nov 2013 03:09:14 +0000 Received: from HPZ200 ([24.10.59.135]) by omta11.emeryville.ca.mail.comcast.net with comcast id lf9D1m00c2v3gNo8Xf9ETn; Tue, 05 Nov 2013 03:09:14 +0000 Message-ID: <4C4C6E7E229F4A1CA40DD456322DB5A7@HPZ200> From: "Dan Ebberts" To: "After Effects Mail List" References: In-Reply-To: Subject: Re: [AE] Expression Date: Mon, 4 Nov 2013 19:09:14 -0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_010C_01CED991.5A3A2B50" 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=1383620954; bh=esEdMagEnvKgNikfUFv8YLYa5rzaI3cqi/iD6bjWViQ=; h=Received:Received:Message-ID:From:To:Subject:Date:MIME-Version: Content-Type; b=KjiyOcMoSbhqsBzd/Fh5Sp6QXhIgVFw6fVQ8/BdzdxENk3ucxSSLP3VVcs/3JCe2V kW0dayF8wevcsMS5p5j8sk7jW6xWarj+BuAv77oM6hI695jMpH3Z7vfA3D/Vo4vwvd lgZI1W8FGJil0PCjr1Ryv/uWsUycIZ/oVLUoeLnM9A0LaC0SUGvvAKwQeFJrNFN9JC AHKjLxBsmk7XiUkyJ2//pbWOjj+Y/bPCCeYuUtS5Oa88hswj5Xh4cZLiWLxlrdbsaS WF9xDOvXNS/RGEOqKN4GQDumx+CQ8gyuKvndI20+lsx8jUjyJzs9puudnzFSR1sF89 5vrzn7DRjmswg== This is a multi-part message in MIME format. ------=_NextPart_000_010C_01CED991.5A3A2B50 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable signature1Something like this, I think: s =3D thisComp.layer("other layer").effect("Slider Control")("Slider"); t =3D time; if (s.numKeys > 0){ n =3D s.nearestKey(time).index; if (s.key(n).time > time) n--; if (n > 0) t =3D time - s.key(n).time; } timeToFrames(t); Dan From: Phil Spitler=20 Sent: Monday, November 04, 2013 5:05 PM To: After Effects Mail List=20 Subject: Re: [AE] Expression I think my description wasn't clear....=20 I'm actually using it to reset a text layer frame counter to zero on = every keyframe of a different layer. Thanks. Phil Phil Spitler | Creative Technologist | Bonfire Labs | t : = 415.394.8200 m : 415.571.3139 Website | Facebook | LinkedIn=20 On Nov 4, 2013, at 4:41 PM, Zack Lovatt wrote: Even easier! Apply this to the slider. L =3D thisComp.layer("Target Layer"); if (L.transform.opacity.numKeys !=3D 0){=20 0; // If the target layer has any keys, set slider to 0. } else {=20 value; // If there are no keys, use the slider value. } Or, more concise: if (thisComp.layer("Target Layer").transform.opacity.numKeys !=3D 0) = 0 else value; Zack Lovatt=20 416.786.4129 www.zacklovatt.com On 4 November 2013 19:36, Phil Spitler wrote: I'm trying to figure out an expression that will reset a slider to 0 = every time there is a keyframe in opacity on a specified layer.=20 I'm guessing it will be some kind of trick where I look at the = key(x).time and compare it to the current time. Any ideas? Cheers. Phil Phil Spitler | Creative Technologist | Bonfire Labs | t : = 415.394.8200 m : 415.571.3139 Website | Facebook | LinkedIn=20 ------=_NextPart_000_010C_01CED991.5A3A2B50 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable signature1
Something like this, I think:
 
s =3D thisComp.layer("other layer").effect("Slider = Control")("Slider");
t =3D time;
if (s.numKeys > 0){
  n =3D s.nearestKey(time).index;
  if (s.key(n).time > time) n--;
  if (n > 0) t =3D time - s.key(n).time;
}
timeToFrames(t);
 
 
Dan
 
Sent: Monday, November 04, 2013 5:05 PM
Subject: Re: [AE] Expression
 
I=20 think my description wasn't clear....=20
 
I'm actually using it to reset a text layer frame counter to zero = on every=20 keyframe of a different layer.
 
Thanks.
 
Phil
 
 
 
 
 
Phil = Spitler =20 |  Creative Technologist   |  Bonfire = Labs =20 |  t : 415.394.8200  m : 415.571.3139

Website | Facebook | LinkedIn
=20
 
On Nov 4, 2013, at 4:41 PM, Zack Lovatt wrote:
Even easier! Apply this to the slider.
 
L=20 =3D thisComp.layer("Target Layer");
if = (L.transform.opacity.numKeys !=3D 0){=20
0; // If the target = layer has any=20 keys, set slider to 0.
} else {
value; // If there are no keys, = use the=20 slider value.
}
 
Or, more concise:
 
if=20 (thisComp.layer("Target Layer").transform.opacity.numKeys !=3D 0) 0 = else=20 value;
 
Zack Lovatt=20
416.786.4129


On 4 November 2013 19:36, Phil Spitler <phil@bonfirelabs.com> wrote:
I'm trying to figure out an = expression=20 that will reset a slider to 0 every time there is a keyframe in = opacity on a=20 specified layer.=20
 
I'm guessing it will be some kind of trick where I look at the=20 key(x).time and compare it to the current time.
 
Any ideas?
 
Cheers.
 
Phil
 
Phil=20 Spitler  |  Creative Technologist   | =20 Bonfire Labs  |  t : 415.394.8200  m : 415.571.3139

Website | Facebook | LinkedIn
 
 
 
------=_NextPart_000_010C_01CED991.5A3A2B50--