Return-Path: Received: from mail-la0-f53.google.com ([209.85.215.53] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP-TLS id 4947024 for AE-List@media-motion.tv; Fri, 11 Jan 2013 11:24:51 +0100 Received: by mail-la0-f53.google.com with SMTP id fn20so1571839lab.26 for ; Fri, 11 Jan 2013 02:29:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type; bh=wCq7QITsQJi+Hts+RDZlddX3PRE0MX+DE0CZbMNXmU0=; b=sn5qFotWacXFG8GyZJNYJskdNnWxfpp10l2MU/zs993s028FWy1OpOjNixk/fM1Kjr D/xRI3u8URuLYwDUsbD0pwBq5f3e9Xhvcf2zPBFGGSx9U4v2P08twkpHB9yjyM22S/Zd hENfCbg+8+KThAOBOnuBqZvW3TVWjaTq5Abws1c1qDK7glsXVHaYDtZV+JRjr+OJI6L5 4frts73cgngnRsS+dZUmizDJCQojOqYvFHbXLzQV8vwjHDQ/XLeAjRqcavJ1cTHD3hi2 gAG//64twTl9DWf56TZGJ9ki9MiVsvJCzd+wHNkbxujKIx3T+mhKEftEa/mmWfyrOFwW RNew== X-Received: by 10.112.26.74 with SMTP id j10mr267108lbg.123.1357900197430; Fri, 11 Jan 2013 02:29:57 -0800 (PST) Return-Path: Received: from [192.168.0.51] (p5792A346.dip0.t-ipconnect.de. [87.146.163.70]) by mx.google.com with ESMTPS id v6sm1924078lbf.11.2013.01.11.02.29.55 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Jan 2013 02:29:56 -0800 (PST) Message-ID: <50EFE99B.8070707@googlemail.com> Date: Fri, 11 Jan 2013 11:29:47 +0100 From: =?ISO-8859-1?Q?Mathias_M=F6hl?= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: After Effects Mail List Subject: Re: Script Question References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------040807090509060802030107" This is a multi-part message in MIME format. --------------040807090509060802030107 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Hi Phil, when you add a new slider, the variables pointing to other sliders get invalid and you should not use them anymore. See in the scripting guide the section "Reference Invalidation" of the PropertyBase object. You need to create a new variable pointing to the RED Slider after creating the other one. You can do this by remembering either the index or the name of the red slider (This is the solution that David suggested). Best, Mathias ------------------------------------------------------------------------ *mamoworld.com tools & tutorials for After Effects* dr. mathias möhl kapellenweg 36, 79100 freiburg, germany phone +49 (0)761 - 4774 584 info@mamoworld.com Am 11.01.2013 00:00, schrieb After Effects Mail List: > From: Phil Spitler > Subject: Script Question > Date: Wed, 9 Jan 2013 23:02:33 -0800 > Message-Id:<10BF9340-252E-4EFA-9959-BA5AE8B7FB00@bonfirelabs.com> > > > --Apple-Mail=_D3C13877-1DE8-4235-9E78-3B04DBB097EA > Content-Transfer-Encoding: quoted-printable > Content-Type: text/plain; > charset=us-ascii > > 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. > > Basically I want to add 2 sliders then get the value of those sliders. > > var RED_Slider =3D selectedLayer.Effects.addProperty("Slider = > Control"); > var red =3D RED_Slider(1).value; > > var GREEN_Slider =3D selectedLayer.Effects.addProperty("Slider = > Control"); > var green =3D GREEN_Slider(1).value; > > If I run the code above, it works great however if I change the order = > and assign the sliders first then try to get the value, AE gives me an = > "invalid object" error. > > So the code below will not work. > > var RED_Slider =3D selectedLayer.Effects.addProperty("Slider = > Control"); > var GREEN_Slider =3D selectedLayer.Effects.addProperty("Slider = > Control"); > > var red =3D RED_Slider(1).value; > 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? > > Cheers. > > Phil > > > > > > Phil Spitler | Creative Technologist | Bonfire Labs | t : = > 415.394.8200 m : 415.571.3139 > > Website | Facebook | LinkedIn > --------------040807090509060802030107 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
Hi Phil,

when you add a new slider, the variables pointing to other sliders get invalid and you should not use them anymore.
See in the scripting guide the section "Reference Invalidation" of the PropertyBase object.

You need to create a new variable pointing to the RED Slider after creating the other one. You can do this by remembering either the index or the name of the red slider (This is the solution that David suggested).

Best,
Mathias
 

mamoworld.com
tools & tutorials for After Effects

dr. mathias möhl
kapellenweg 36, 79100 freiburg, germany
phone +49 (0)761 - 4774 584
info@mamoworld.com



Am 11.01.2013 00:00, schrieb After Effects Mail List:
From: Phil Spitler <phil@bonfirelabs.com>
Subject: Script Question
Date: Wed, 9 Jan 2013 23:02:33 -0800
Message-Id: <10BF9340-252E-4EFA-9959-BA5AE8B7FB00@bonfirelabs.com>


--Apple-Mail=_D3C13877-1DE8-4235-9E78-3B04DBB097EA
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

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.

Basically I want to add 2 sliders then get the value of those sliders.

	var RED_Slider =3D selectedLayer.Effects.addProperty("Slider =
Control");
	var red =3D RED_Slider(1).value;

	var GREEN_Slider =3D selectedLayer.Effects.addProperty("Slider =
Control");
	var green =3D GREEN_Slider(1).value;

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

So the code below will not work.

	var RED_Slider =3D selectedLayer.Effects.addProperty("Slider =
Control");
	var GREEN_Slider =3D selectedLayer.Effects.addProperty("Slider =
Control");

	var red =3D RED_Slider(1).value;
	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?

Cheers.

Phil





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

Website | Facebook | LinkedIn



--------------040807090509060802030107--