Return-Path: Received: from mail-wi0-f169.google.com ([209.85.212.169] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP-TLS id 5352560 for AE-List@media-motion.tv; Mon, 20 Jan 2014 01:26:06 +0100 Received: by mail-wi0-f169.google.com with SMTP id e4so3886915wiv.4 for ; Sun, 19 Jan 2014 16:30:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=cXelb/2Rw+f+f+k7524pLnUldp9tQoA1RCfdJqDrjKk=; b=EwC05DpXLEdlpzkTfVG4V2Kt7dB0DG4S+CtS8u/pOtd9gugc+pxw/OgGrifrc75NZH fDTW4hYhEanZB8WXpwM9yz8YLZyYxkHYhanLo/qfM7fDnhAeff/daAXR/JPfDw4/1IVz SxTdNbwbs/E1iCmtdMyi50G6XlfydhZo0I6N7EGAdSgzp4yz9JXB9RCY/dCOz3U77v3J C0WHlIAW1tp3f2kuagJJlYAzFwx81fVwUOpsILcypoqtqXoojvIfyunbL7nGbMNUTIuB /cYfRpalwXGka1i3gIBCxCfwIPmYqaXVy9s6kfSg9FJ+OVPz5siFdPCjDQHQ7a+TlXAZ T6Jg== MIME-Version: 1.0 X-Received: by 10.180.187.16 with SMTP id fo16mr187771wic.26.1390177806465; Sun, 19 Jan 2014 16:30:06 -0800 (PST) Received: by 10.194.54.9 with HTTP; Sun, 19 Jan 2014 16:30:06 -0800 (PST) In-Reply-To: References: Date: Sun, 19 Jan 2014 18:30:06 -0600 Message-ID: Subject: Re: [AE] scripting for pseudo-effects From: Drew Gilmore To: After Effects Mail List Content-Type: multipart/alternative; boundary=001a11c266c4543fa204f05bfe34 --001a11c266c4543fa204f05bfe34 Content-Type: text/plain; charset=ISO-8859-1 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! Drew On Sun, Jan 19, 2014 at 6:02 PM, David Torno wrote: > 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 = curLayer.Effects.addProperty("VP-Path"); > vppath.property("Azimuth").expression = ("50"); > > var vp = curLayer.Effects.addProperty("Virtual Projector"); > vp.property("Azimuth").expression = ("50"); > > This works because you are changing a value to a valid effect property > immediately after creating each effect. > > VERSION 2 > > var vppath = curLayer.Effects.addProperty("VP-Path"); > var vp = curLayer.Effects.addProperty("Virtual Projector"); > > vp.property("Azimuth").expression = ("50"); > vppath.property("Azimuth").expression = ("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 = curLayer.property("ADBE Effect Parade").property("VP-Path"); > var vp = curLayer.property("ADBE Effect Parade").property("Virtual > Projector"); > > //Change properties > vp.property("Azimuth").expression = ("50"); > vppath.property("Azimuth").expression = ("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: > > var vppath = curLayer.Effects.addProperty("VP-Path"); > vppath.property("Azimuth").expression = ("50"); > > var vp = curLayer.Effects.addProperty("Virtual Projector"); > vp.property("Azimuth").expression = ("50"); > > > But this doesn't: > > var vppath = curLayer.Effects.addProperty("VP-Path"); > var vp = curLayer.Effects.addProperty("Virtual Projector"); > > vp.property("Azimuth").expression = ("50"); > vppath.property("Azimuth").expression = ("50"); > > > (FWIW, VP-Path is the custom effect, Virtual Projector is a plugin effect.) > > Thanks, > Drew > > > --001a11c266c4543fa204f05bfe34 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
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!

Drew


On Sun, Jan 19, 2014 at 6:02 PM, David T= orno <torno@sydefxink.com> wrote:
The reason is that the first object bec= omes invalid once you run addProperty again. You can add the properties bac= k 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");=

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

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

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


Doing this though, should work.
VERSION 3
//Create effects
curLayer.Effects.a= ddProperty("VP-Path");
curLayer.Effects.addProperty(&qu= ot;Virtual Projector");

//Assign effects = variables
var vppath =3D curLayer.property("ADBE Effect Parade").prope= rty("VP-Path");
var vp =3D=A0curLayer.property("AD= BE Effect Parade").property("Virtual Projector");
=
//Change properties
vp.property(&quo= t;Azimuth").expression =3D ("50");
vppath.property("Azimuth").expression =3D= ("50");


------
David Torno
Visual Effects Artist and Super= visor
-----------= -------------------------------------
http://www.syd= efxink.com=A0=A0(main portfolio)
http://aeioweyou.blogspot.com=A0(vfx t= utorials and AE scripts blog)
http://macte= x.blogspot.com=A0=A0(free textures blog)
=

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

Tha= nks yeah, now that I poke around it's clearly something else I'm do= ing wrong... I think I have it working. But now I'm curious. Why does t= his work:

var vppath =3D curLayer.Effects.addProperty("VP-Pa= th");
vppath.property("Azimuth").expression =3D (&= quot;50");

var vp =3D curLayer.Effects.ad= dProperty("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").expression = =3D ("50");
vppath.property("Azimut= h").expression =3D ("50");


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

<= div>Thanks,
Drew


--001a11c266c4543fa204f05bfe34--