Return-Path: Received: from mail-qe0-f51.google.com ([209.85.128.51] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP-TLS id 5275619 for AE-List@media-motion.tv; Tue, 05 Nov 2013 18:14:13 +0100 Received: by mail-qe0-f51.google.com with SMTP id q19so5185976qeb.38 for ; Tue, 05 Nov 2013 09:15:44 -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=Ojlk7y1pwcWx1IYzyZoTpjPwqxSn5ZMeSPsmb4glQJ4=; b=iV/I4SoJNrT3WgLjfcHD4J4I9ylxwI06q8SDoTZUj3Hqt/+FJ/RG3EhmW7eAsnxisY alwW5Dpp2+Es+03IrXElzlGXrseB8hZaQ+kZOB4WjZlpHznII3u3wONKPgXXyBs2cwwY DAqKXeKeS+G7J7gPMJqV1xy9NALL4seObNAsFnRPygykX85uwYrj1hkpZCwi+VaoFQwD B6wEj8neEmt5bKG1CiDiksJ+TLQtzpofZ1NCdP+uJSQ+lspQ1aRHuf0PNkvVbFN4LxhG S5ZX7r6jPNpYY9CEA3k2U6k96Y+3SskLgQzPRuAXsb9Fr3blEUeZwPpInFtne4orjJCJ B5pg== X-Gm-Message-State: ALoCoQnpz4UjusKgpIRUgIzPqAO+AEhpVoZEmsGWDAyT9uwCWbSNoKuoA/DmPiIqsCPtZMpB5IPl X-Received: by 10.49.84.65 with SMTP id w1mr6414977qey.0.1383671744691; Tue, 05 Nov 2013 09:15:44 -0800 (PST) Return-Path: Received: from [10.0.0.227] ([65.223.58.66]) by mx.google.com with ESMTPSA id j1sm15663883qaa.6.2013.11.05.09.15.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Nov 2013 09:15:42 -0800 (PST) From: Phil Spitler Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: multipart/alternative; boundary="Apple-Mail=_8C7B8639-2981-45D2-95DD-ADB66A213DBE" Subject: Re: [AE] Expression Date: Tue, 5 Nov 2013 09:15:41 -0800 In-Reply-To: To: "After Effects Mail List" References: Message-Id: X-Mailer: Apple Mail (2.1283) --Apple-Mail=_8C7B8639-2981-45D2-95DD-ADB66A213DBE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Perfect, thanks Dan. Phil Phil Spitler | Creative Technologist | Bonfire Labs | t : = 415.394.8200 m : 415.571.3139 Website | Facebook | LinkedIn On Nov 4, 2013, at 7:09 PM, Dan Ebberts wrote: > Something like this, I think: > =20 > 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); > =20 > =20 > Dan > =20 > From: Phil Spitler > Sent: Monday, November 04, 2013 5:05 PM > To: After Effects Mail List > Subject: Re: [AE] Expression > =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 > 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"); >> 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. >> } >> =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: >> 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 >> =20 >> =20 >=20 > =20 --Apple-Mail=_8C7B8639-2981-45D2-95DD-ADB66A213DBE Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=iso-8859-1 Perfect, thanks Dan.

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:09 PM, Dan Ebberts wrote:

signature1
Something like this, I think:
 
s = thisComp.layer("other layer").effect("Slider Control")("Slider");
t = time;
if (s.numKeys > 0){
  n = s.nearestKey(time).index;
  if (s.key(n).time > time) n--;
  if (n > 0) t = time - s.key(n).time;
}
timeToFrames(t);
 
 
Dan
 
Sent: Monday, November 04, 2013 5:05 PM
Subject: Re: [AE] Expression
 
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
 
 
 
 
 
Phil Spitler  |  Creative Technologist   |  Bonfire Labs  |  t : 415.394.8200  m : 415.571.3139

Website | Facebook | LinkedIn
 
On Nov 4, 2013, at 4:41 PM, Zack Lovatt wrote:

Even easier! Apply this to the slider.
 
L = thisComp.layer("Target Layer");
if (L.transform.opacity.numKeys != 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 != 0) 0 else value;
 
Zack Lovatt
416.786.4129


On 4 November 2013 19:36, Phil Spitler <phil@bonfirelabs.com> 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.
 
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
 
 
 

--Apple-Mail=_8C7B8639-2981-45D2-95DD-ADB66A213DBE--