From: "TIM THIESSEN" Received: from resqmta-po-09v.sys.comcast.net ([96.114.154.168] verified) by media-motion.tv (CommuniGate Pro SMTP 6.1.0) with ESMTPS id 6444725 for ae-list@media-motion.tv; Wed, 02 May 2018 23:03:48 +0200 Received: from resomta-po-01v.sys.comcast.net ([96.114.154.225]) by resqmta-po-09v.sys.comcast.net with ESMTP id Dx1zfM0yAVyXKDz0Yfs1Kz; Wed, 02 May 2018 21:09:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20161114; t=1525295390; bh=Zd2Efk9FhpDHmh70Kgq5RmVFN5z/lXYsu4PxggiVaJA=; h=Received:Received:Date:From:Reply-To:To:Message-ID:Subject: MIME-Version:Content-Type; b=RS3mLhO9gw/5lTXoYf+/fSyhme/mBQHAoYsgSKTFVQYsiTWblVU1l+Wrlbjbn8GLr BOlWrjoLsC9b58V6h1mBUiWTpYTd4tF8StsASBhX5uRxc4BJxr91nlCygoOkyOd1Yt JQnxFCPE6Q/p9jF2xvIfILC0bvLcm/8cuHlaITAQbMiKamrsfigwRVJddsrr4NJA2Y J9Cbbi2t11RDnR0Q6cRT0/PC7h1oIO5PNGlzLH1xWd5wxZdLmuB7EBayG38JELhgNO GBXRzOVp3QfEE+B2ADTYxUqlrMZ53ah36D0G3kYB5TIJTxSTJm6Tsda4+upM0EeO3T ZZcnyiB8t4igg== Received: from oxapp-hoc-41o.email.comcast.net ([96.118.241.162]) by resomta-po-01v.sys.comcast.net with ESMTPS id Dz0YflZ9wmkAHDz0YfWK14; Wed, 02 May 2018 21:09:50 +0000 Date: Wed, 2 May 2018 14:09:50 -0700 (PDT) Reply-To: TIM THIESSEN To: After Effects Mail List Message-ID: <1486482659.1027842.1525295390370@connect.xfinity.com> In-Reply-To: References: Subject: Re: [AE] scripting help - getting colour value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev12 X-Originating-IP: ::ffff:107.1.199.10 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4wfHbTAvwt9Gv3hphA3SfCa5FLUa5IZXXe2uGiUYaSUtNutnhaznOHK9Zhg0v26Ku1KXV79dgd8rU1VK3sYYeT88Ty3SdeRRN/xJLwhqyYA/YvaTv77Xu+ Qcmz9sjGpAaJp1MD1ZYZijKSUECbPFasBQDNDJf8pREeS3eqCduCVW6PwE5MU5HnRkSuMigK87mAZa9rEm/G5L6aVnpPoJ2jkZI= I'm thinking the problem is you are applying an expression to the controlle= r 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 retur= ns 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 retur= n 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. tt > 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 w= hen 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 sampleIma= ge to read the RGB values. The script then reads the value of the colour c= ontrol to get the RGB values. >=20 > As I said - works fine if I run the script from the scripts menu. But th= e same thing in a GUI and run from the ScriptsUI Panel doesn=E2=80=99t 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