ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

How do I control a layer with starting- and end points in After Effects?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dan Tore Jørgensen
How do I control a layer with starting- and end points in After Effects?
on Mar 28, 2010 at 3:45:35 pm

Hi

I hope I've posted this in the right place, if not please point this newcomer in the right direction.

I'm looking for a way to control a comp or layer (image or video) in the same way as you control the Beam effect or VC's Light Saber preset. Or a way to replace the beam in these two examples with another layer. I need to animate end point and starting point just like in these examples, but I just can't seem to figure out how.

Is there a simple effect than can do this or some kind of script, or something?
I've been looking and searching and trying, but no luck, so I figured I could try and post the problem out there and hope for a solution. I'm almost sure the solution is right in front of me and that I just can't see it, for some reason :-)

I'd really appreciate it if anyone had a tip for a solution.

Thanks


Return to posts index

Michael Szalapski
Re: How do I control a layer with starting- and end points in After Effects?
on Mar 28, 2010 at 10:24:04 pm

Do you mean like the corner pin effect?

- The Great Szalam
(The 'Great' stands for 'Not So Great, in fact, Extremely Humble')

No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.


Return to posts index

Dan Tore Jørgensen
Re: How do I control a layer with starting- and end points in After Effects?
on Mar 29, 2010 at 6:14:57 am

Hi Michael, thanks for replying

Yes, well, almost like a CP effect, but with only two pins (or points), one on each side, if possible :-)

In short, I would like to replace the simple, one colored beam in AE's Beam Effect with a video layer. Four corner pins will be way too complicated to animate.


Return to posts index


Michael Szalapski
Re: How do I control a layer with starting- and end points in After Effects?
on Mar 29, 2010 at 8:55:15 pm

Add your video layer to the comp. Create six null objects. Put one null object at each corner of your footage and the two extra ones on the sides (one on each side midway between the top and the bottom).
It would probably be a good idea to name your nulls. TOPRIGHT, etc.
Parent the corner nulls on the left side to the middle null on that side. Parent the corner nulls on the right side to the middle null on that side.
Apply the corner pin expression to the layer.
Alt-click the stopwatch for the top left corner position in the corner pin effect and type the following expression:
L = thisComp.layer(\"TOPLEFT\");
L.toWorld(L.anchorPoint)

Replace TOPLEFT with whatever you decided to name your top left null. Do the same for the other three corner points replacing the text with the corresponding null\'s name.
Now, when you animate the side nulls, the layer should react. You can even animate scale and rotation of them and not just position.
That should work.
I\'d test it out and attach a sample project, but I\'m on the road heading out for a week of shooting in Georgia and typing this on my iPhone so...no access to AE at the moment.

- The Great Szalam
(The 'Great' stands for 'Not So Great, in fact, Extremely Humble')

No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.


Return to posts index

Michael Szalapski
Re: How do I control a layer with starting- and end points in After Effects?
on Mar 29, 2010 at 8:55:18 pm

Add your video layer to the comp. Create six null objects. Put one null object at each corner of your footage and the two extra ones on the sides (one on each side midway between the top and the bottom).
It would probably be a good idea to name your nulls. TOPRIGHT, etc.
Parent the corner nulls on the left side to the middle null on that side. Parent the corner nulls on the right side to the middle null on that side.
Apply the corner pin expression to the layer.
Alt-click the stopwatch for the top left corner position in the corner pin effect and type the following expression:
L = thisComp.layer(\"TOPLEFT\");
L.toWorld(L.anchorPoint)

Replace TOPLEFT with whatever you decided to name your top left null. Do the same for the other three corner points replacing the text with the corresponding null\'s name.
Now, when you animate the side nulls, the layer should react. You can even animate scale and rotation of them and not just position.
That should work.
I'd test it out and attach a sample project, but I'm on the road heading out for a week of shooting in Georgia and typing this on my iPhone so...no access to AE at the moment.

- The Great Szalam
(The 'Great' stands for 'Not So Great, in fact, Extremely Humble')

No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.


Return to posts index

Dan Tore Jørgensen
Re: How do I control a layer with starting- and end points in After Effects?
on Mar 29, 2010 at 10:02:03 pm

Thanks a million, Michael!

That worked out just perfect! Have so far only tried your suggestion in a quick test, but so far it works just as I hoped for.

Got a syntax error in line 1 at first, but after removing those backslashes everything worked perfect.

But anyway, you saved the day - fantastic!
Whish you the best on your shoot, thanks again :-)


Return to posts index


Michael Szalapski
Re: How do I control a layer with starting- and end points in After Effects?
on Mar 29, 2010 at 10:29:41 pm

Sorry about that. Those backslashes weren't in what I typed. It's a weird thing with the mobile page when you preview your posts. I'll have to make a mental note not to do that. Glad it's working for you. And thanks for the well-wishing! I'm enjoying the downtown Savannah historic district tonight. Shoot in the morning!

- The Great Szalam
(The 'Great' stands for 'Not So Great, in fact, Extremely Humble')

No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.


Return to posts index

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