Return-Path: Received: from omta2.brinkster.com ([65.182.109.101] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP id 5325845 for AE-List@media-motion.tv; Sat, 21 Dec 2013 18:14:05 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by omta2.brinkster.com (Postfix) with ESMTP id 19EDF10267B for ; Sat, 21 Dec 2013 10:17:08 -0700 (MST) X-Virus-Scanned: amavisd-new at omta2.brinkster.com Received: from omta2.brinkster.com ([127.0.0.1]) by localhost (omta2.brinkster.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id szvxBgYrWbPZ for ; Sat, 21 Dec 2013 10:17:04 -0700 (MST) Received: from mta5.brinkster.com (unknown [65.182.109.84]) by omta2.brinkster.com (Postfix) with ESMTPS id 6A40D101EE7 for ; Sat, 21 Dec 2013 10:17:04 -0700 (MST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mta5.brinkster.com (Postfix) with ESMTP id 77F513200D0 for ; Sat, 21 Dec 2013 10:17:06 -0700 (MST) X-Virus-Scanned: amavisd-new at mta5.brinkster.com Received: from mta5.brinkster.com ([127.0.0.1]) by localhost (mta5.brinkster.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C0WF285QY5Q6 for ; Sat, 21 Dec 2013 10:17:02 -0700 (MST) Received: from mail5c.brinkster.com (mail5c.brinkster.com [10.0.6.192]) by mta5.brinkster.com (Postfix) with ESMTP id C63EB3200D1 for ; Sat, 21 Dec 2013 10:17:02 -0700 (MST) Date: Sat, 21 Dec 2013 10:17:12 -0700 (MST) From: "Roland Kahlenberg (RoRK)" To: After Effects Mail List Message-ID: <606227890.922733.1387646232109.JavaMail.root@broadcastgems.com> In-Reply-To: Subject: Re: [AE] Expressions: Somewhere between Auto Orient and Auto Orient Y only MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [220.255.1.151] X-Mailer: Zimbra 7.2.2_GA_2852 (ZimbraWebClient - GC31 (Win)/7.2.2_GA_2852) Robert, your Expression, with activeCamera will result in an Expression error popup if there is no activeCamera where the Timeline Indicator is located. The Expression error may also occur when an activeCamera is present - it's a strange error. Thanks to Dan Wilk from plabt, I'm now able to use the try/catch routine to overcome Expression errors such as this. Here's the script you amended from DanE's, with the try/catch statements - //start script cam = false; try {cam = thisComp.activeCamera; } catch (err) {}; if (cam == 1) { v = cam.toWorldVec([0,0,1]); lookAt(position,position+v) } else { value // set value to what you want should the Expression result in an error ie activeCamera is false } //end script HTH - Roland Kahlenberg * LATEST AE Workshop * http://www.broadcastGEMs.com/MediaScreamer01/bGEMs_MoGraphIntensity_Promo_MG01_18Nov_2013_VBR4_01.mp4 Intensive mocha & AE Training in Singapore and Other Dangerous Locations Imagineer Systems (mocha) Certified Instructor & Adobe After Effects ACE/ACI CS6 http://www.broadcastGEMs.com/training ----- Original Message ----- From: "Robert Kjettrup" To: "After Effects Mail List" Sent: Saturday, December 21, 2013 11:14:59 PM Subject: Re: [AE] Expressions: Somewhere between Auto Orient and Auto Orient Y only i had the same exact problem a few weeks ago, and i hacked together an expression to do it. It actually does the same as Dan E's version, but ofcourse Dan's is much more elegant, simpler and works with the camera as a child under a null, something i struggled to get to work in my version :-D thanks Dan for this, i will save that as an animation preset... with one small adjustment, adding support for the active camera: cam = thisComp.activeCamera; v = cam.toWorldVec([0,0,1]); lookAt(position,position+v) and for anyone interested, here is my simple much worse version that breaks if the camera is parented: cam = thisComp.activeCamera; fromPoint = cam.position; atPoint = cam.pointOfInterest; lookAt(fromPoint, atPoint) DONT USE this :-D and my expression for making it work under nulls was more complicated and needed 2 extra nulls for the expression to look to. I couldnt get .toWorldVec to work with the cameras position and target, only with nulls. Happy Holidays to all on the AE-list. Robert