Mailing List AE-List@media-motion.tv ? Message #51422
From: Dan Ebberts <debberts@comcast.net>
Subject: Re: [AE] Expression
Date: Mon, 4 Nov 2013 19:09:14 -0800
To: After Effects Mail List <AE-List@media-motion.tv>
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
 
 
 
 
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to ListMaster