Return-Path: Received: from atl4mhob02.myregisteredsite.com ([209.17.115.40] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP id 5352577 for AE-List@media-motion.tv; Mon, 20 Jan 2014 01:58:33 +0100 Received: from mailpod.hostingplatform.com ([10.30.71.203]) by atl4mhob02.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id s0K12VnZ002205 for ; Sun, 19 Jan 2014 20:02:31 -0500 Received: (qmail 24958 invoked by uid 0); 20 Jan 2014 01:02:31 -0000 X-TCPREMOTEIP: 75.51.173.21 X-Authenticated-UID: torno@sydefxink.com Received: from unknown (HELO ?10.0.1.5?) (torno@sydefxink.com@75.51.173.21) by 0 with ESMTPA; 20 Jan 2014 01:02:30 -0000 From: David Torno Content-Type: multipart/alternative; boundary=Apple-Mail-F733A6AD-9DFD-4273-A068-CB5DEC8CB478 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (1.0) Subject: Re: [AE] scripting for pseudo-effects Message-Id: <9D34F5D9-D1C3-4C40-8557-CBF02C52F6A6@sydefxink.com> Date: Sun, 19 Jan 2014 17:02:28 -0800 References: In-Reply-To: To: After Effects Mail List X-Mailer: iPhone Mail (11B511) --Apple-Mail-F733A6AD-9DFD-4273-A068-CB5DEC8CB478 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable My terminology may be off a bit too in explaining that. You'll come across t= his issue in a few spots in ExtendScript as a heads up. David Torno Technical Director http://www.ghosttownmedia.com O: 213.739.2290 C: 818.391.6060 -------------------- http://aeioweyou.blogspot.com "The most useless day is that in which we do not laugh" -Charles Field > On Jan 19, 2014, at 4:30 PM, Drew Gilmore wrote: >=20 > Ahh, ok. I may have to let the logic of that sink in, but I think I get it= . This is what happens when I only script every year or so. Thanks very much= for the help! >=20 > Drew >=20 >=20 >> On Sun, Jan 19, 2014 at 6:02 PM, David Torno wrote:= >> The reason is that the first object becomes invalid once you run addPrope= rty again. You can add the properties back to back like in version 2, but yo= u would need to assign them to variables afterwards like in version 3, to be= able to access any attributes for them. >>=20 >> 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"); >>=20 >> This works because you are changing a value to a valid effect property im= mediately after creating each effect. >>=20 >> 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"); >>=20 >> 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 variab= le is valid by running: >> vppath.isValid; >> vp.isValid; >>=20 >>=20 >> Doing this though, should work. >> VERSION 3 >> //Create effects >> curLayer.Effects.addProperty("VP-Path"); >> curLayer.Effects.addProperty("Virtual Projector"); >>=20 >> //Assign effects variables >> var vppath =3D curLayer.property("ADBE Effect Parade").property("VP-Path"= ); >> var vp =3D curLayer.property("ADBE Effect Parade").property("Virtual Proj= ector"); >>=20 >> //Change properties >> vp.property("Azimuth").expression =3D ("50"); >> vppath.property("Azimuth").expression =3D ("50"); >>=20 >>=20 >> ------ >> 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) >>=20 >>> On Jan 19, 2014, at 2:01 PM, Drew Gilmore wrote: >>>=20 >>> Thanks yeah, now that I poke around it's clearly something else I'm doin= g wrong... I think I have it working. But now I'm curious. Why does this wor= k: >>>=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 effec= t.) >>>=20 >>> Thanks, >>> Drew >=20 --Apple-Mail-F733A6AD-9DFD-4273-A068-CB5DEC8CB478 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
My terminology may be off a bit too in= explaining that. You'll come across this issue in a few spots in ExtendScri= pt as a heads up.

David Torno
Technical Director
<= div>O: 213.739.2290
C: 818.391.6060
--------------------=

= "The most useless day is that in which we d= o not laugh"
-Charles Fiel= d

On Jan 19, 2014, at 4:30 PM, Drew Gilmore <<= a href=3D"mailto:dotsandlines@gmail.com">dotsandlines@gmail.com> wrot= e:

Ahh, ok. I m= ay have to let the logic of that sink in, but I think I get it. This is what= happens when I only script every year or so. Thanks very much for the help!=

Drew


On Sun, Jan 19, 2014 at 6:02 PM, David To= rno <torno@sydefxink.com> wrote:
The reason is that the first object beco= mes invalid once you run addProperty again. You can add the properties back t= o back like in version 2, but you would need to assign them to variables aft= erwards like in version 3, to be able to access any attributes for them.
VERSION 1
var vppath =3D curLayer.Effects.addProperty("VP-Path");
vppat= h.property("Azimuth").expression =3D ("50");

va= r vp =3D curLayer.Effects.addProperty("Virtual Projector");
vp.property("Azimuth").expression =3D ("50");
<= /blockquote>
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");
=
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 some= thing 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.ad= dProperty("VP-Path");
curLayer.Effects.addProperty("Virtual Projec= tor");

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

//Change properties
vp.property("Azim= uth").expression =3D ("50");
vppath.property("Azimuth").expression =3D ("50");


------
David Torno
Visual Effects Artist and Superv= isor
--------= ----------------------------------------
http://www.syde= fxink.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 y= eah, 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");<= /div>
vppath.property("Azimuth").expression =3D ("50");
var vp =3D curLayer.Effects.addProperty("Virtual Projector");
vp.property("Azimuth").expression =3D ("50");

<= /div>

But this doesn't:

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

vp.property("Azimuth").expression =3D ("50");
<= /div>
vppath.property("Azimuth").expression =3D ("50");


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

Thanks,
Drew


= --Apple-Mail-F733A6AD-9DFD-4273-A068-CB5DEC8CB478--