Mailing List AE-List@media-motion.tv ? Message #52222
From: Roland Kahlenberg (RoRK) <aemaillist@broadcastgems.com>
Subject: Re: [AE] Expressions: Somewhere between Auto Orient and Auto Orient Y only
Date: Sat, 21 Dec 2013 12:05:06 -0700 (MST)
To: After Effects Mail List <AE-List@media-motion.tv>
AccCKK!!! Sorry about the earlier hiccup.

I think this should work -

//start script
cam = false;
try {cam = thisComp.activeCamera; }
catch (err) {};
if (cam) {
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" <robert@stvmayday.dk>
To: "After Effects Mail List" <AE-List@media-motion.tv>
Sent: Sunday, December 22, 2013 2:19:00 AM
Subject: Re: [AE] Expressions: Somewhere between Auto Orient and Auto Orient Y only


Hi Roland


Yes, you are ofcourse correct in your observation about it not handling a non-camera situation.


But i cant get your try/catch expression to work in this case either, and i cant seem to find where the error is in the expression.... hmmmm....


maybe i should just get back to the christmas stuff instead of spending time on this that not even is a problem i have right now for any project, and sorry to Byron for hijacking his thread. Hope some of my input has been useful and on topic :-D



Robert





2013/12/21 Roland Kahlenberg (RoRK) < aemaillist@broadcastgems.com >


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" < robert@stvmayday.dk >
To: "After Effects Mail List" < AE-List@media-motion.tv >
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




+---End of message---+
To unsubscribe send any message to < ae-list-off@media-motion.tv >
 
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to ListMaster