Return-Path: Received: from mail-ob0-f179.google.com ([209.85.214.179] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP-TLS id 5368268 for AE-List@media-motion.tv; Fri, 07 Feb 2014 11:00:21 +0100 Received: by mail-ob0-f179.google.com with SMTP id wo20so3719839obc.24 for ; Fri, 07 Feb 2014 02:04:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=szlJxXb4qZvJcDXZofK5+8KKprfsG1RJaS65iRVeAXE=; b=f66eFNk/8j8hinBLXlW/WEWBLYVPl/e6ljKqR93+J61Z8RivcYvk10AQS6pjc07jtp nwZJUU1xtD6tNbZeCftsDyYae+Uu7OdoIyNpTwTCyOYkJE82o0Nm+9FUbMZLEREPQoCl 1fKF4+RQu4+I152ike0U5+w2v17lC8sLhtoZgApfnENontu5c/RZ6GWs0akNX8o+OjX0 NYUYJP3dr9UyAVOJOfwUoemQgGAyHSdakfHHvZx8Y3mJkSf2SwrqEisrGRzlDQ0tI+Oq N28kIg4sPrVR5DapjTEDMFmomk6S7oxoANuOFyDfwn3bqSEn6Z72D+ynwlyb9Xlsz+t+ tdqA== X-Received: by 10.60.98.174 with SMTP id ej14mr11986402oeb.16.1391767495017; Fri, 07 Feb 2014 02:04:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.97.7 with HTTP; Fri, 7 Feb 2014 02:04:34 -0800 (PST) In-Reply-To: References: From: Salvador Date: Fri, 7 Feb 2014 10:04:34 +0000 Message-ID: Subject: Re: [AE] Trigger opacity from markers AND use marker duration To: After Effects Mail List Content-Type: multipart/alternative; boundary=089e0122912c268ac204f1ce1f58 --089e0122912c268ac204f1ce1f58 Content-Type: text/plain; charset=ISO-8859-1 Hi, I had to tweak the expression a little to make it work correctly. Lloyd, the expression you gave me has one flaw : Opacity turns off as soon as the next marker is closer to the current marker, no matter its duration. This seemed to work : n = 0; if (marker.numKeys > 0){ n = marker.nearestKey(time).index; if (marker.key(n).time > time){ n--; } } if (n == 0){ 0; } else { (time >= marker.key(n).time && time <= (marker.key(n).time + marker.key(n).duration))?100:0; } Thanks, Salvador On Mon, Feb 3, 2014 at 6:23 PM, Salvador wrote: > > On Mon, Feb 3, 2014 at 6:07 PM, Lloyd Alvarez wrote: > >> myNearestKey = marker.nearestKey(time); >> (myNearestKey.comment == "active" && time >= myNearestKey.time && time <= >> (myNearestKey.time + myNearestKey.duration))?100:0 >> > > Thx guys. It's perfect and actually very simple. > > I forgot how reactive and helpful the AE community was. > --089e0122912c268ac204f1ce1f58 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

I had to tweak the expression a lit= tle to make it work correctly. Lloyd, the expression you gave me has one fl= aw : Opacity turns off as soon as the next marker is closer to the current = marker, no matter its duration.

This seemed to work :

n =3D 0;

if (marker.numKeys > 0){
=A0 n =3D marker.nearestKey(= time).index;
=A0 if (marker.key(n).time > time){
=A0 =A0 n--;
= =A0 }
}

if (n =3D=3D 0){
=A0 0;
} else {
=A0 (time >= =3D marker.key(n).time && time <=3D =A0(marker.key(n).time + mar= ker.key(n).duration))?100:0;
}


Thanks,


Salvador



On Mon, Feb 3, 2014 at 6:23 PM, Salvador <s.zalvide= a@gmail.com> wrote:

On M= on, Feb 3, 2014 at 6:07 PM, Lloyd Alvarez <lists@aescripts.com> wrote:
myNearestKey =3D marker.nearestKey(time= );
(myNearestKey.comment =3D=3D "active" && tim= e >=3D myNearestKey.time && time <=3D (myNearestKey.time + my= NearestKey.duration))?100:0

Thx guys. It's perfect and actually very simple.=

I for= got how reactive and helpful the AE community was.

--089e0122912c268ac204f1ce1f58--