From: "Chris Zwar" Received: from mail-pg0-f49.google.com ([74.125.83.49] verified) by media-motion.tv (CommuniGate Pro SMTP 6.1.0) with ESMTPS id 6444769 for AE-List@media-motion.tv; Thu, 03 May 2018 02:45:19 +0200 Received: by mail-pg0-f49.google.com with SMTP id e1-v6so509136pga.6 for ; Wed, 02 May 2018 17:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chriszwar-com.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=UN8gM2AOeKza18eXay9QskUWpwRYl5N9kPJ2QtuiiYo=; b=gYfabIuW8UVO+C+bSE7lWt3z34VhzxMzwyE9PbLR1YX2iv9FeNaWVY5WLRfLD1Bk0U XKxE9xxPMmZnljuRxXlZDwlkXyz5tv6c+Ex1UtneLADBsAo91B21o+c/+vB0OTUSyr0X yWWCQTI6T8KoSgS47wP7WiJXJVGulngqycS9NbNVkVmvPOlNo6CNwD1AjhjwCJcrLe/k MwQiChfyeEA/MtdJyNg98wP6HT4fEh2eXKpcpm6JtaxqrDyNt3OUjOQbgH04ESBXhJHG b2AhvEAOtvS0cHE+rVZLougnnq7XU/8pksmkAFAtyFXkKRUaE+J8bXTjVRB83DHmISHg cCQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=UN8gM2AOeKza18eXay9QskUWpwRYl5N9kPJ2QtuiiYo=; b=Hbgo2yIG5v3pxixintyfSWuGXxBqC3HJ7ZDNsJlYP39uMoDWfmjnb7nCUw6ywiEmFL qTzLlc0TP/XiAIqDwyXz0aBS30T65wBAkWfUvxL2usb5juIAG/Hi49yY72CJFhaxd1T9 hn/BnW3g490xUxJfnq08kg8lINJuiwoyW7RjHd+qBsDu2VmJ8C195YqnLb2atgLsy9wd 6jsyiQYJz5r6UttP1MoeIodqRPIf4uX5xLGTRWQbi25NKIpSrNrMn/RgGzulmN6POnnk IZd9klv8t2Wrb3+xOB9wicidUdqTbt39mI89dVIdlY/GVl9CA7Bw04a/ZMKvF6Bb0/PC nGtg== X-Gm-Message-State: ALQs6tAEJS0IQ50bNX+1Zm2maMGQFAGCgjNg9XWlmw7uZHVy+/qn7C0Z PL5s78AZ0RWdz2YKPgtKxsL3A4BPXPc= X-Google-Smtp-Source: AB8JxZqZQUFXFtbC8cZnqD921An8vMpR8NHQCgJItpNFzXj0RM7xqxfX9cTb4lZwe62+SOZtxBHgcQ== X-Received: by 2002:a63:9911:: with SMTP id d17-v6mr17983763pge.106.1525308682013; Wed, 02 May 2018 17:51:22 -0700 (PDT) Return-Path: Received: from [192.168.0.6] ([101.164.85.130]) by smtp.gmail.com with ESMTPSA id g3-v6sm1105788pgr.34.2018.05.02.17.51.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 May 2018 17:51:21 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: [AE] scripting help - getting colour value Date: Thu, 3 May 2018 10:51:18 +1000 References: To: After Effects Mail List In-Reply-To: Message-Id: <1337319D-93B7-4EA2-8FC0-B87A3EAA58E9@chriszwar.com> X-Mailer: Apple Mail (2.3445.6.18) I=E2=80=99ll have a look at using a variable but it=E2=80=99s simpler if = I don=E2=80=99t have to. =20 The thing that stumps me is that the script works if run from the = scripts menu, it just doesn=E2=80=99t work when opened from the windows = menu. I had a quick play yesterday and I changed the .value to = .valueAtTime(time, false). The =E2=80=9Cfalse=E2=80=9D flag is supposed = to force the return of the expression and not the underlying = pre-expression value. It still doesn=E2=80=99t work. The colour = control that is applied by the script works as expected after the script = has run, so there=E2=80=99s no issue with the script applying the effect = and the expression. I=E2=80=99ll try using a slider instead but I appreciate any other = suggestions... > On 3 May 2018, at 7:09 am, TIM THIESSEN = wrote: >=20 > I'm thinking the problem is you are applying an expression to the = controller and then asking the value of the controller - the problem is = that if you apply an expression to say position and then ask the for the = value it returns the default position. rather than add the expression to = sample the color just create a variable to sample the point you need and = then it will return the correct color. I don't know your whole = application so that may not be possible, and the last time I tried = sampleImage() I had some weird colors show up. >=20 > tt >=20 >> On April 30, 2018 at 10:29 PM Chris Zwar = wrote: >>=20 >>=20 >> Hi, >>=20 >> Just after some scripting help. I have a simple script that works = fine when run without a GUI, but if I use exactly the same code in a = version with a GUI it doesn=E2=80=99t work any more. >>=20 >> The aim is to sample the colour of a layer. The script applies a = colour control / expression control effect, with an expression that uses = sampleImage to read the RGB values. The script then reads the value of = the colour control to get the RGB values. >>=20 >> As I said - works fine if I run the script from the scripts menu. = But the same thing in a GUI and run from the ScriptsUI Panel doesn=E2=80=99= t work. The RGB array variable is just 0. So what am I doing wrong? >>=20 >> Cheers, >>=20 >>=20 >> -Chris >>=20 >> Offending code: >>=20 >> myLayer[0].property("ADBE Effect Parade").addProperty("ADBE Color = Control=E2=80=9D); >>=20 >> myLayer[0].property("ADBE Effect Parade").property("ADBE Color = Control").property("ADBE Color = Control-0001").expression=3D"x=3DthisLayer.width/2;y=3DthisLayer.height/2;= c=3DsampleImage([x,y], radius =3D [2, 2], postEffect =3D true, t =3D = time);"; >>=20 >> var RGB=3DmyLayer[0].property("ADBE Effect Parade").property("ADBE = Color Control").property("ADBE Color Control-0001").value; >>=20 >>=20 >> +---End of message---+ >> To unsubscribe send any message to >=20 > +---End of message---+ > To unsubscribe send any message to