Return-Path: Received: from mail-qa0-f47.google.com ([209.85.216.47] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP-TLS id 5274846 for AE-List@media-motion.tv; Tue, 05 Nov 2013 04:08:05 +0100 Received: by mail-qa0-f47.google.com with SMTP id w8so762986qac.20 for ; Mon, 04 Nov 2013 19:09:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:mime-version:content-type:subject:date :in-reply-to:to:references:message-id; bh=ArRy5K+6WwGX8nQ6UWApW80EbAj1bIJMvITpYkXsHXw=; b=bFExrzHCkYfwVt9GjiJ5ZtFkZ2AxKIUjUr1uo3e9PaquaW3rCP7I3t+7GLfOEFosHg /M9RS6HpEnjjRSlwZBqITNmvwcEPwuwCFVR8AZ+wcpJK8vAu2IQOkf4CqLcRr8BWAwFf nuZcLIFJhV/+t/VvdspJIEBvC0hr2mIPzW8xNtKdNdbyhSY6Ojh9xTpBP/kbZzvzpugL DAjopetMHNIOLAeLQn5RGZVmGg28tVsjwQ8Y3ojZd3dMOZm6ffKA6UUU3N72Lzh2Exck 9HiufdAlGngsbNyaoSZhtjIc+m6nV7L1i8DRo6Ue7lI2QDUhDfatrion8Qivo+9JK73O Qwhg== X-Gm-Message-State: ALoCoQnr7OTOgj0nF+5/6EkMsCJV3rhKAM6dyEV+ME92jyN9hTwZ1Nu1TOGLgEDo3L/++PfOmMLd X-Received: by 10.49.72.3 with SMTP id z3mr26954832qeu.23.1383620975848; Mon, 04 Nov 2013 19:09:35 -0800 (PST) Return-Path: Received: from [10.0.0.227] ([65.223.58.66]) by mx.google.com with ESMTPSA id b10sm54285681qeg.7.2013.11.04.19.09.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Nov 2013 19:09:33 -0800 (PST) From: Phil Spitler Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: multipart/alternative; boundary="Apple-Mail=_8AF0F17B-B2AD-4D54-BC10-EEB5585F055B" Subject: Re: [AE] Expression Date: Mon, 4 Nov 2013 19:09:31 -0800 In-Reply-To: To: "After Effects Mail List" , "mylenium@mylenium.de" References: Message-Id: <29D39141-F98D-42F6-8507-09E05D98801F@bonfirelabs.com> X-Mailer: Apple Mail (2.1283) --Apple-Mail=_8AF0F17B-B2AD-4D54-BC10-EEB5585F055B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Nope, just one layer that has keyframes and the counter on the 2nd layer = so I wouldn't need to loop through each layer. Phil Phil Spitler | Creative Technologist | Bonfire Labs | t : = 415.394.8200 m : 415.571.3139 Website | Facebook | LinkedIn On Nov 4, 2013, at 7:02 PM, mylenium@mylenium.de wrote: > You would have to iterate through all the layers and then use another = loop to chekck for keyframes. depending on how they are laid out, you = would also need code to check if multiple keys exist at the same time. = Could potentially become convoluted... > =20 > Mylenium > =20 > [Pour Myl=E8ne, ange sur terre]=20 > -----------------------------------------=20 > www.mylenium.de > =20 >> Phil Spitler hat am 5. November 2013 um 02:05 = geschrieben:=20 >>=20 >> 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. >> =20 >> Thanks. >> =20 >> Phil >> =20 >> =20 >> =20 >> =20 >>=20 >> signature1 Phil Spitler | Creative Technologist | Bonfire Labs = | t : 415.394.8200 m : 415.571.3139 >>=20 >> Website | Facebook | LinkedIn >>=20 >> On Nov 4, 2013, at 4:41 PM, Zack Lovatt wrote: >>=20 >>> Even easier! Apply this to the slider. >>> =20 >>> L =3D thisComp.layer("Target Layer");=20 >>> if (L.transform.opacity.numKeys !=3D 0){ =20 >>> 0; // If the target layer has any keys, set slider to 0.=20 >>> } else { =20 >>> value; // If there are no keys, use the slider value.=20 >>> } >>> =20 >>> Or, more concise: >>> =20 >>> if (thisComp.layer("Target Layer").transform.opacity.numKeys !=3D 0) = 0 else value; >>>=20 >>> Zack Lovatt >>> 416.786.4129 >>> www.zacklovatt.com >>>=20 >>>=20 >>> On 4 November 2013 19:36, Phil Spitler wrote:=20= >>> 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. >>> =20 >>> Any ideas? >>> =20 >>> Cheers. >>> =20 >>> Phil >>> =20 >>> Phil Spitler | Creative Technologist | Bonfire Labs | t : = 415.394.8200 m : 415.571.3139 >>>=20 >>> Website | Facebook | LinkedIn --Apple-Mail=_8AF0F17B-B2AD-4D54-BC10-EEB5585F055B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1 Nope, just one layer that has keyframes and the = counter on the 2nd layer so I wouldn't need to loop through each = layer.

Phil

signature1 Phil = Spitler  |  Creative Technologist   |  Bonfire Labs  |  t : 415.394.8200  m : = 415.571.3139

Website | Facebook | LinkedIn

On Nov 4, 2013, at 7:02 PM, mylenium@mylenium.de = wrote:

You = would have to iterate through all the layers and then use another loop = to chekck for keyframes. depending on how they are laid out, you would = also need code to check if multiple keys exist at the same time. Could = potentially become = convoluted...
 
Mylenium
 
[Pour Myl=E8ne, ange sur terre] 
-------------------------= ---------------- 
Phil Spitler < 

I = think my description wasn't clear....
 
I'm actually = using it to reset a text layer frame counter to zero on every keyframe = of a different = layer.
 
Thanks.
 
Phil<= /div>
 
 
 
 
<= div>
signature1  Bonfire = Labs  |  t : 415.394.8200  m : = 415.571.3139

Website | Facebook | 
Even easier! Apply this to the = slider.
 
L =3D = thisComp.layer("Target Layer"); 
if = (L.transform.opacity.numKeys !=3D 0){  
0; // If the target layer has any = keys, set slider to 0. 
} else {  
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;