Return-Path: Received: from atl4mhob09.myregisteredsite.com ([209.17.115.47] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP id 4946085 for AE-List@media-motion.tv; Thu, 10 Jan 2013 08:26:11 +0100 Received: from mailpod.hostingplatform.com (mail.networksolutionsemail.com [205.178.146.50]) by atl4mhob09.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id r0A7VDbk003592 for ; Thu, 10 Jan 2013 02:31:13 -0500 Received: (qmail 15918 invoked by uid 0); 10 Jan 2013 07:31:12 -0000 Received: from unknown (HELO ?10.0.1.3?) (torno@sydefxink.com@75.51.175.213) by 0 with ESMTPA; 10 Jan 2013 07:31:12 -0000 Subject: Re: [AE] Script Question References: From: David Torno Content-Type: multipart/alternative; boundary=Apple-Mail-ADBB4785-D656-4EC5-AA08-C2CA78B22C9B X-Mailer: iPhone Mail (9B176) In-Reply-To: Message-Id: <16B96542-5975-466D-A635-A4851B28D9DD@sydefxink.com> Date: Wed, 9 Jan 2013 23:31:10 -0800 To: After Effects Mail List Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (1.0) --Apple-Mail-ADBB4785-D656-4EC5-AA08-C2CA78B22C9B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Not sure I fully understand, but I do think what is causing the error is tha= t the "selectedLayer" is changed if you add a layer then add another just af= ter it. So when you added a slider, saved it's value, the code was able to a= ssociate each grouping you scripted.=20 Hopefully that made sense? :) David Torno Visual Effects Artist & Supervisor http://www.ghosttownmedia.com O: 213.739.2290 C: 818.391.6060 --------------------- http://www.sydefxink.com http://aeioweyou.blogspot.com http://mactex.blogspot.com "The most useless day is that in which we do not laugh" -Charles Field On Jan 9, 2013, at 11:02 PM, Phil Spitler wrote: > I'm having a fun time figuring out a scripting problem and thought I would= ask the advice of the script gurus on the list. >=20 > Basically I want to add 2 sliders then get the value of those sliders. >=20 > var RED_Slider =3D selectedLayer.Effects.addProperty("Slider Contro= l"); > var red =3D RED_Slider(1).value; >=20 > var GREEN_Slider =3D selectedLayer.Effects.addProperty("Slider Cont= rol"); > var green =3D GREEN_Slider(1).value; >=20 > If I run the code above, it works great however if I change the order and a= ssign the sliders first then try to get the value, AE gives me an "invalid o= bject" error. >=20 > So the code below will not work. >=20 > var RED_Slider =3D selectedLayer.Effects.addProperty("Slider Contro= l"); > var GREEN_Slider =3D selectedLayer.Effects.addProperty("Slider Cont= rol"); >=20 > var red =3D RED_Slider(1).value; > var green =3D GREEN_Slider(1).value; >=20 >=20 > It's almost as if when I add the Green Slider, it forgets the Red Slider. >=20 > Any ideas? >=20 > Cheers. >=20 > Phil >=20 >=20 >=20 >=20 >=20 > Phil Spitler | Creative Technologist | Bonfire Labs | t : 415.394.8= 200 m : 415.571.3139 >=20 > Website | Facebook | LinkedIn >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 --Apple-Mail-ADBB4785-D656-4EC5-AA08-C2CA78B22C9B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Not sure I fully understan= d, but I do think what is causing the error is that the "selectedLayer" is c= hanged if you add a layer then add another just after it. So when you added a= slider, saved it's value, the code was able to associate each grouping you s= cripted. 

Hopefully that made sense? :)
David Torno
Visual Effects Artist & Supervisor
= O: 213.739.2290
C: 818.391.6060
---------------------
http://www.sydefxink.comhttp://aeioweyou.blogspot.com

"The most useless day is that in which we do n= ot laugh"
-Charles Field

On Jan 9, 2013, at 11= :02 PM, Phil Spitler <phil@bonfir= elabs.com> wrote:

<= div>I'm having a fun time figuring out a scripting problem and thought I wou= ld ask the advice of the script gurus on the list.

Basica= lly I want to add 2 sliders then get the value of those sliders.
<= br>
var RED_Slider =3D selectedLayer.Effects.addProperty("Slider Control");<= /div>
= var red =3D RED_Slider(1).value;

var GREEN_Sl= ider =3D selectedLayer.Effects.addProperty("Slider Control");
var g= reen =3D GREEN_Slider(1).value;

If I ru= n the code above, it works great however if I change the order and assign th= e sliders first then try to get the value, AE gives me an "invalid object" e= rror.

So the code below will not work.
= var RED_Slider =3D selectedLayer.Effects.addProperty("Slider Control= ");
= var GREEN_Slider =3D selectedLayer.Effects.addProperty("Slid= er Control");

var red =3D RED_Slider(1).va= lue;
= var green =3D GREEN_Slider(1).value;

It's almost as if when I add the Green Slider, it= forgets the Red Slider.

Any ideas?

<= /div>
Cheers.

Phil




Phil Spitler  |  Creative Technologist   |  Bonfire Labs  |  t : 415.394.8200  m : 415.571.3139

Website | Facebook | LinkedIn

=







= --Apple-Mail-ADBB4785-D656-4EC5-AA08-C2CA78B22C9B--