Return-Path: Received: from qmta09.emeryville.ca.mail.comcast.net ([76.96.30.96] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP id 4830677 for ae-list@media-motion.tv; Thu, 30 Aug 2012 20:54:57 +0200 Received: from omta21.emeryville.ca.mail.comcast.net ([76.96.30.88]) by qmta09.emeryville.ca.mail.comcast.net with comcast id t6fc1j0041u4NiLA96voa4; Thu, 30 Aug 2012 18:55:48 +0000 Received: from HPZ200 ([76.20.32.7]) by omta21.emeryville.ca.mail.comcast.net with comcast id t6vn1j00U09DSM08h6vn6x; Thu, 30 Aug 2012 18:55:48 +0000 Message-ID: From: "Dan Ebberts" To: "After Effects Mail List" References: In-Reply-To: Subject: Re: [AE] 2d lookAt expression Date: Thu, 30 Aug 2012 11:55:47 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_001C_01CD86A6.649A9D80" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 15.4.3555.308 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308 This is a multi-part message in MIME format. ------=_NextPart_000_001C_01CD86A6.649A9D80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Try this: target =3D thisComp.layer("Null 2"); d =3D target.transform.position - transform.position; radiansToDegrees(Math.atan2(d[1],d[0])) Dan From: Robert Kjettrup=20 Sent: Thursday, August 30, 2012 11:43 AM To: After Effects Mail List=20 Subject: [AE] 2d lookAt expression Hi Right now i am stuck trying to write a seemingly simple expression.=20 I want a normal 2d null to "look at" another 2d null and can't figure = out what the expression should look like.=20 LookAt() seems like it is only for 3d layers? and my goto resource for = quick tips for expressions, Dan Ebberts motionscript.com doesn't have = anything on something this simple :-) Robert Kjettrup / Grafiker / STV Mayday Mobil: 25 18 95 16 Mail: robert@stvmayday.dk ------=_NextPart_000_001C_01CD86A6.649A9D80 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Try this:
 
target =3D thisComp.layer("Null 2");
d =3D target.transform.position - transform.position;
radiansToDegrees(Math.atan2(d[1],d[0]))
 
Dan
 
Sent: Thursday, August 30, 2012 11:43 AM
Subject: [AE] 2d lookAt expression
 
Hi
 
Right now i am stuck trying to write a seemingly simple expression. =
I want a normal 2d null to "look at" another 2d null and can't = figure out=20 what the expression should look like.
LookAt() seems like it is only for 3d layers? and my goto resource = for=20 quick tips for expressions, Dan Ebberts motionscript.com doesn't have = anything on=20 something this simple :-)
 
 
Robert Kjettrup / Grafiker / STV Mayday
Mobil: 25 18 = 95=20 16
Mail: robert@stvmayday.dk
------=_NextPart_000_001C_01CD86A6.649A9D80--