ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

"Look At" Expression???

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
cow
Michael Cavallaro
"Look At" Expression???
on Jun 15, 2008 at 4:55:22 am

I know I've seen this somewhere before but I can't find it for the life of me. Does AE have a "Look At" controller similar to a 3D program?

Basically, I need to have one end of a line follow another layer while the other end stays "stuck" to some text.

There's probably many ways to do this so any suggestions would help. I was thinking that the anchor point of the line would be at the "fix point" and the line would just rotate to continually face the moving layer. This doesn't account for the size of the line changing when the object moves to-away but it will do.

Thanks in advance...

MikeC


Return to posts index

cow
Mike Clasby
Re: "Look At" Expression???
on Jun 15, 2008 at 6:50:16 am

1) "look At" goes on a 3D layer's Orientation like this:

lookAt(thisComp.layer("my text").position, position)

Since look at is not really Point At, it more like Orient Toward or face At, you need to scrub the x, y or z to see what gets it pointing at the layer you want. Often it's Y rotation at 90 degrees.

look At can be a bit tricky, at least for me.

2) Anyway, I think it's easier to connect two layers with the beam effect, like in this mod of a Dan Ebberts technique:

So add the Beam effect to a 2D Black Solid (make it big enough to let the beam stretch as far as needed). To the two 3D layers you want to connect (or have a line pointing from one to the other, use this expression for the Beam's "Starting Point" (Copy the expression, Alt-click the Starting Point Stop watch, Paste):

target = thisComp.layer("my text");
fromComp(target.toComp(target.anchorPoint));

and this expression on the beams' Ending Point:

target = thisComp.layer("My Other Layer");
fromComp(target.toComp(target.anchorPoint));

Obviously you need to put the correct layer names in for "my text" and "My Other Layer".

Adjust the beams length and location by tweaking the Beam's Length and Time parameters. You can also adjust the starting and ending thickness.

This setup is just an illusion, adapted for 2D Beam, from Dan's tut for 2D Corner Pin, from here:

http://www.motionscript.com/design-guide/threeD-corner-pin.html

But like Dan says it maintains the illusion even with a moving Camera. By an illusion I mean the beam is on a 2D layer, not 3D, it just looks 3D. Along those lines, the only thing that really messes this up is if you mistakenly change the solid layer's position, so that it's not right in front of the camera, then the beam can seem cutoff at one end. So it's not a bad idea to maybe even lock the layer once you have the beam adjusted the way you want. This setup works for me in a quick test.

If this doesn't do what you want, holler.








Return to posts index

cow
Michael Cavallaro
Re: "Look At" Expression???
on Jun 15, 2008 at 7:07:10 am

PERFECTO!!!!

This is even better than I was hoping for. The beam technique is a great idea.

Thanks a million!

MikeC



Return to posts index


cow
Mike Clasby
Re: "Look At" Expression???
on Jun 15, 2008 at 7:08:44 am

After thinking about it, methinks the 2D solid with beam on it only needs to be comp size.



Return to posts index

stephen dixon
Re: "Look At" Expression???
on Oct 23, 2015 at 5:25:55 am

It has always bugged me that there's not a good 2D lookAt function in AE, so I made one:
http://blob.pureandapplied.com.au/lookat-me/

It can be used to create a better Auto-Orient function too.

Stephen Dixon
Editor, Animator, Motionographer
Museum Victoria


Return to posts index

ion popescu
Re: "Look At" Expression???
on Jul 11, 2019 at 8:42:58 pm

This is exactly what I was hoping to find. It's GREAT!

Thank you and God bless you

If it look's good, It's good


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]