Return-Path: Received: from atl4mhob15.myregisteredsite.com ([209.17.115.53] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP id 5352548 for AE-List@media-motion.tv; Mon, 20 Jan 2014 00:58:28 +0100 Received: from mailpod.hostingplatform.com ([10.30.71.205]) by atl4mhob15.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id s0K02QGG001721 for ; Sun, 19 Jan 2014 19:02:26 -0500 Received: (qmail 16479 invoked by uid 0); 20 Jan 2014 00:02:26 -0000 X-TCPREMOTEIP: 75.51.173.21 X-Authenticated-UID: torno@sydefxink.com Received: from unknown (HELO ?10.0.1.7?) (torno@sydefxink.com@75.51.173.21) by 0 with ESMTPA; 20 Jan 2014 00:02:24 -0000 From: David Torno Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: multipart/alternative; boundary="Apple-Mail=_62F3DA88-AA24-4F2A-9107-E074891D93E3" Subject: Re: [AE] scripting for pseudo-effects Date: Sun, 19 Jan 2014 16:02:19 -0800 In-Reply-To: To: "After Effects Mail List" References: Message-Id: <834E9036-7ED5-4D24-853D-7B4B96F1ECE9@sydefxink.com> X-Mailer: Apple Mail (2.1283) --Apple-Mail=_62F3DA88-AA24-4F2A-9107-E074891D93E3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 The reason is that the first object becomes invalid once you run = addProperty again. You can add the properties back to back like in = version 2, but you would need to assign them to variables afterwards = like in version 3, to be able to access any attributes for them. VERSION 1 > var vppath =3D curLayer.Effects.addProperty("VP-Path"); > vppath.property("Azimuth").expression =3D ("50"); >=20 > var vp =3D curLayer.Effects.addProperty("Virtual Projector"); > vp.property("Azimuth").expression =3D ("50"); This works because you are changing a value to a valid effect property = immediately after creating each effect. VERSION 2 > var vppath =3D curLayer.Effects.addProperty("VP-Path"); > var vp =3D curLayer.Effects.addProperty("Virtual Projector"); >=20 > vp.property("Azimuth").expression =3D ("50"); > vppath.property("Azimuth").expression =3D ("50"); vppath becomes invalid the second you add another property (vp), at = which point you cannot change something that's invalid. You can check if = a variable is valid by running: vppath.isValid; vp.isValid; Doing this though, should work. VERSION 3 //Create effects curLayer.Effects.addProperty("VP-Path"); curLayer.Effects.addProperty("Virtual Projector"); //Assign effects variables var vppath =3D curLayer.property("ADBE Effect = Parade").property("VP-Path"); var vp =3D curLayer.property("ADBE Effect Parade").property("Virtual = Projector"); //Change properties vp.property("Azimuth").expression =3D ("50"); vppath.property("Azimuth").expression =3D ("50"); ------ David Torno Visual Effects Artist and Supervisor http://www.ghosttownmedia.com E: david@ghosttownmedia.com O: 213.739.2290 C: 818.391.6060 ------------------------------------------------ http://www.sydefxink.com (main portfolio) http://aeioweyou.blogspot.com (vfx tutorials and AE scripts blog) http://mactex.blogspot.com (free textures blog) On Jan 19, 2014, at 2:01 PM, Drew Gilmore wrote: > Thanks yeah, now that I poke around it's clearly something else I'm = doing wrong... I think I have it working. But now I'm curious. Why does = this work: >=20 > var vppath =3D curLayer.Effects.addProperty("VP-Path"); > vppath.property("Azimuth").expression =3D ("50"); >=20 > var vp =3D curLayer.Effects.addProperty("Virtual Projector"); > vp.property("Azimuth").expression =3D ("50"); >=20 >=20 > But this doesn't: >=20 > var vppath =3D curLayer.Effects.addProperty("VP-Path"); > var vp =3D curLayer.Effects.addProperty("Virtual Projector"); >=20 > vp.property("Azimuth").expression =3D ("50"); > vppath.property("Azimuth").expression =3D ("50"); >=20 >=20 > (FWIW, VP-Path is the custom effect, Virtual Projector is a plugin = effect.) >=20 > Thanks, > Drew --Apple-Mail=_62F3DA88-AA24-4F2A-9107-E074891D93E3 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1 The = reason is that the first object becomes invalid once you run addProperty = again. You can add the properties back to back like in version 2, but = you would need to assign them to variables afterwards like in version 3, = to be able to access any attributes for them.

VERSION = 1
var = vppath =3D = curLayer.Effects.addProperty("VP-Path");
vppath.property("Azimut= h").expression =3D ("50");

var vp =3D = curLayer.Effects.addProperty("Virtual = Projector");
vp.property("Azimuth").expression =3D = ("50");
This works because you = are changing a value to a valid effect property immediately after = creating each effect.

VERSION = 2
var vp =3D = curLayer.Effects.addProperty("Virtual = Projector");

vp.property("Azimuth").expressio= n =3D = ("50");
vppath.property("Azimuth").expression =3D= ("50");
vppath becomes = invalid the second you add another property (vp), at which point you = cannot change something that's invalid. You can check if a variable is = valid by = running:
vppath.isValid;
vp.isValid;


Doing this though, should = work.
curLa= yer.Effects.addProperty("Virtual = Projector");

//Assign effects = variables
var vppath =3D curLayer.property("ADBE Effect = Parade").property("VP-Path");
var vp = =3D curLayer.property("ADBE Effect Parade").property("Virtual = Projector");

//Change = properties
vp.property("Azimuth").expression =3D = ("50");
vppath.property("Azimuth").expression =3D= ("50");
http://www.ghosttownmedia.com
-------------------= -----------------------------
http://www.sydefxink.com  (main = portfolio)
http://aeioweyou.blogspot.com (vfx tutorials = and AE scripts blog)
http://mactex.blogspot.com  (free = textures blog)

On Jan 19, 2014, at 2:01 PM, Drew Gilmore wrote:

Thanks yeah, = now that I poke around it's clearly something else I'm doing wrong... I = think I have it working. But now I'm curious. Why does this = work:

var vppath =3D = curLayer.Effects.addProperty("VP-Path");
vppath.property("Azimut= h").expression =3D ("50");

var vp =3D = curLayer.Effects.addProperty("Virtual = Projector");
vp.property("Azimuth").expression =3D = ("50");


But this = doesn't:

var vppath =3D = curLayer.Effects.addProperty("VP-Path");
var vp =3D = curLayer.Effects.addProperty("Virtual = Projector");

vp.property("Azimuth").expressio= n =3D = ("50");
vppath.property("Azimuth").expression =3D= ("50");


(FWIW, = VP-Path is the custom effect, Virtual Projector is a plugin = effect.)

Thanks,
Drew

= --Apple-Mail=_62F3DA88-AA24-4F2A-9107-E074891D93E3--