From: "Chris Zwar" Received: from mail-pg0-f47.google.com ([74.125.83.47] verified) by media-motion.tv (CommuniGate Pro SMTP 6.1.0) with ESMTPS id 6445257 for AE-List@media-motion.tv; Fri, 04 May 2018 05:07:46 +0200 Received: by mail-pg0-f47.google.com with SMTP id g20-v6so7832577pgv.1 for ; Thu, 03 May 2018 20:13:52 -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=vNLNE0bstgRLklwUOtNAeVwQWnupJa31nATLE9XNs6g=; b=ihDG4NLxwqs+UZE921MiXcc+Fc/UM1cgphw2MiborvQI74NzmWUkLipJpxFDI5GqqV HLcTzMUYqllZR+XOilx+Ja/QkWFN6+GR3nesHtvyRxLg9pd1Litp7kwhLzzwThvS6As+ jXmj/HtHY6dPsZwDy8vH2w2IfpK5mTCa5BiDcp1ZcHgMSt+E9FQpw7FbwroE/fXk/Fds FH1MfHMeMw9dkYNzZ/u6D571pAykUrjNSFp15mLiPLAQrmPpvg8lAPFplyXHPoAUqTEC LpX4xrr1H6XeQK9ZvuUJKKflNqCgZns19EDewUMPIUmeT3HbNbci1PiQfaxXnw+kZWuq RVrg== 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=vNLNE0bstgRLklwUOtNAeVwQWnupJa31nATLE9XNs6g=; b=AbtAZ36qYxS7+8SjVvotIDHgpNDZ/ylqkKNelpsv1Hrj58uBOYMvwZizHwaHBIwnTa kKosvRB8qDw8Ik2K+8IyjY6YIyaXn35y0jksrZMpwKH9ctoWo4HcVjf3atsfJyLrBBX6 D7Mdp23+6+37MOgWdxWu/CGI8dxAFtR5r1YrGUu76ppSQMll73Fte4pDU1F8SsmC2aSf WW/e27JXwtE1UtEtWlCB3PP2LVnscz7emg8a1zLOmyCMY8eBF15y0l/MU8deVCUnKWoA t1iNu2Zgd+LoqrMMaOaHhkyXnE5yd6yaMNiJk7KRZWKREiBVOu/KGn0mWBIy5v9HqSG2 LOdQ== X-Gm-Message-State: ALQs6tBIeRG79r45gQG1hQerIDVUNJcJv97FuOqOiQVolj1urN2W/FOC FPSBjaxixlLrwAE6a8p7wNu5visI/Mc= X-Google-Smtp-Source: AB8JxZrxg7bDIpvyyFRdUvdIhHvv/hwkCRSULy0iEv0V5fqB3SZUd8EGtRbSsWnmUCzfi0ZbKMN/wg== X-Received: by 2002:a17:902:581:: with SMTP id f1-v6mr649370plf.48.1525403630302; Thu, 03 May 2018 20:13:50 -0700 (PDT) Return-Path: Received: from [192.168.3.137] (220-244-139-34.static.tpgi.com.au. [220.244.139.34]) by smtp.gmail.com with ESMTPSA id e5sm31026311pfk.28.2018.05.03.20.13.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 May 2018 20:13:49 -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: Fri, 4 May 2018 13:13:46 +1000 References: To: After Effects Mail List In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3445.6.18) Thanks for your interest. Yes your script works fine, and it=E2=80=99s = prompted me to play around a bit more. My full script is a few hundred = lines and I won=E2=80=99t post it all, but I have stripped it down to = the basics and I=E2=80=99ve found where the problem comes from. In my full script I am applying the Color Link effect and sampling the = colour after it is applied. It=E2=80=99s this effect which is not = working in CC 2017 or CC 2018. As an experiment, I tried applying the = basic fill effect instead, and when I do that the script does work as = expected. I=E2=80=99ve pasted a version of the script below. If you leave it = as-is. the color link effect is applied and the sampleImage only returns = 0. If you comment out the color link effect to prevent it being added, = then only the fill effect is applied. Then the sampleImage correctly = returns the values of 1,0,0. I would love to know if you can replicate this behaviour - thanks again. -Chris { function ZaksTest(thisObj) { =20 var ZaksTestData =3D new Object (); ZaksTestData.strApply=3D"Apply"; var colourExpression=3D"x=3DthisLayer.width/2;y=3DthisLayer.height/2;\n = c=3DsampleImage([x,y], radius =3D [2, 2], postEffect =3D true, t =3D = time);\n c"; // Set up the GUI =20 function ZaksTest_buildUI(thisObj) { var myPanel =3D (thisObj instanceof Panel) ? thisObj : new = Window ("palette","ZaksTest",undefined, {resizable:true}); var res =3D=20 "group { \ orientation:'column', = alignment:['fill','top'], \ apply: Group { \ alignment:['right','top'], \ applyBtn: Button { text:'" + = ZaksTestData.strApply + "' }, \ }, \ }"; =20 myPanel.grp =3D myPanel.add(res) var apply=3DmyPanel.grp.apply.applyBtn; // Apply button - main part =20 apply.onClick=3Dfunction()=20 { var myComp =3D app.project.activeItem; app.beginUndoGroup("ZaksTest"); clearOutput(); var myLayer =3D myComp.selectedLayers[0]; myLayer.property("ADBE Effect Parade").addProperty("ADBE Fill"); // comment out the color link effect and the script works. If it's = enabled it doesn't // myLayer.property("ADBE Effect Parade").addProperty("ADBE Color Link"); myLayer.property("ADBE Effect Parade").addProperty("ADBE Color = Control"); myLayer.property("ADBE Effect Parade").property("ADBE Color = Control").property("ADBE Color = Control-0001").expression=3DcolourExpression; var RGB=3D[1,1,1,1]; var r=3D0;g=3D0;b=3D0; RGB=3DmyLayer.property("ADBE Effect Parade").property("ADBE Color = Control")(1).value; r=3DRGB[0]; g=3DRGB[1]; b=3DRGB[2]; alert("RGB: "+r+","+g+","+b); app.endUndoGroup(); } // Set panel resizing myPanel.layout.layout (true); myPanel.grp.minimumSize=3DmyPanel.grp.size; myPanel.layout.resize(); myPanel.onResizing =3D myPanel.onResize=3D function () = {this.layout.resize()} return myPanel; } var ZaksTestPal =3D ZaksTest_buildUI(thisObj); =20 if ((ZaksTestPal !=3D null) && (ZaksTestPal instanceof Window)) { ZaksTestPal.center(); ZaksTestPal.show(); } } ZaksTest(this) ; }=