Return-Path: Received: from qmta14.emeryville.ca.mail.comcast.net ([76.96.27.212] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP id 4564602 for ae-list@media-motion.tv; Thu, 15 Dec 2011 21:48:51 +0100 Received: from omta23.emeryville.ca.mail.comcast.net ([76.96.30.90]) by qmta14.emeryville.ca.mail.comcast.net with comcast id 9Yi31i0051wfjNsAEYuoDX; Thu, 15 Dec 2011 20:54:48 +0000 Received: from HPZ200 ([76.20.32.7]) by omta23.emeryville.ca.mail.comcast.net with comcast id 9Ymq1i00a09DSM08jYmrmr; Thu, 15 Dec 2011 20:46:51 +0000 Message-ID: <81986F20246840618EEC514F1EB750B6@HPZ200> From: "Dan Ebberts" To: "After Effects Mail List" References: In-Reply-To: Subject: Re: [AE] LookAt() in 2D space? Date: Thu, 15 Dec 2011 12:54:59 -0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0036_01CCBB28.C1181A50" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3538.513 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3538.513 This is a multi-part message in MIME format. ------=_NextPart_000_0036_01CCBB28.C1181A50 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable This should work: L =3D thisComp.layer("target"); v =3D L.toComp(L.anchorPoint) - toComp(anchorPoint); radiansToDegrees(Math.atan2(v[1],v[0])) Dan From: Byron Nash=20 Sent: Thursday, December 15, 2011 12:35 PM To: After Effects Mail List=20 Subject: [AE] LookAt() in 2D space? I feel like I have done this before but I'm coming up dry so far. What = is the syntax for getting a 2D layer to point at another one? LookAt() = seems to only work for 3D layers. =20 thanks, Byron ------=_NextPart_000_0036_01CCBB28.C1181A50 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
This should work:
 
L =3D thisComp.layer("target");
v =3D L.toComp(L.anchorPoint) - toComp(anchorPoint);
radiansToDegrees(Math.atan2(v[1],v[0]))
 
 
Dan
 
From: Byron Nash
Sent: Thursday, December 15, 2011 12:35 PM
Subject: [AE] LookAt() in 2D space?
 
I=20 feel like I have done this before but I'm coming up dry so far. What is = the=20 syntax for getting a 2D layer to point at another one? LookAt() seems to = only=20 work for 3D layers. =20
 
thanks,
 
Byron
------=_NextPart_000_0036_01CCBB28.C1181A50--