AE ENHANCERS

Expressions/Scripts/Presets
It is currently Tue May 21, 2013 5:25 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Controling individual vertices in a path
PostPosted: Sun Mar 23, 2008 7:50 pm 
Offline

Joined: Sun Mar 23, 2008 6:50 am
Posts: 5
Hello.

I am looking for a way to animate a path, by adjusting the X and Y properties of a separate node. I've been told that it's only possible with a script. Since I have no experience writing (or even working with) scripts, I'm asking if there is one out there already, or if someone would be kind enough to write one, or explain how to write one.

Thanks.


Last edited by mihak on Mon Mar 24, 2008 7:14 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Controling individual verticles in a path
PostPosted: Mon Mar 24, 2008 5:32 am 
Offline
User avatar

Joined: Mon Apr 30, 2007 5:55 am
Posts: 157
Location: United States, Ohio
Have you looked at http://www.motionscript.com?

_________________
"Up And Atom

No...No

Up And At Them!"


Top
 Profile  
 
 Post subject: Re: Controling individual verticles in a path
PostPosted: Mon Mar 24, 2008 7:48 am 
Offline

Joined: Sat Jun 05, 2004 7:59 am
Posts: 645
Location: London, UK
Here's a script that can be used to animate the individual vertices of a mask path:
Rototracking palette for AE (6.5, 7, CS3)

Although it's intended for rototracking, you can use it to control mask vertices by other means. Here are some steps you can try:
1. Download the RotAE1.1.jsx script from the above link.
2. Select File > Scripts > Run Script File and choose the RotAE1.1.jsx script to launch the floating palette.
3. Create a new comp, with a solid layer of the same size.
4. Select the mask pen tool and draw a 3 point mask on the solid layer.
5. Twirl open the timeline properties and select Mask 1.
6. Click the palette's "Apply Tracker" button.
7. With the layer selected, press the U key twice quickly (the UU shortcut reveals all altered properies). You'll see a motion tracker with 3 points has been added to the layer.
8. Double click the layer in the timeline to open its layer window. Select to view Motion Tracker Points and you'll see each point is at the position of one of the mask vertices.

If you were doing this on a footage layer, you could now use the tracker controls to create keyframes. But in this example, we're doing it with nulls and expressions.

9. Select Layer > New > Null Object. Create three nulls, called Null 1, Null 2, Null 3.
10. Select all three nulls and press P to view the Position properties.
11. Select the solid's Tracker 1 > Track Point 1 > Attach Point property and do Edit > Copy.
12. Select the Null 1 Position property and do Edit > Paste.
13. Repeat with the other two track points.
Return to looking at the composition panel. There are now 3 nulls, one positioned at each of the mask vertices.

14. Animate the Null Position properties.
15. Select the Track Point 1 Attach Point property and choose Animation > Add Expression.
16. Either use the expression pickwhip to link to the Null 1 Position property, or add this expression:
Code:
thisComp.layer("Null 1").transform.position

17. Repeat for the other two track points, linking them to Null 2 and 3.
18. Select all three Attach Point properties and choose Animation > Keyframe Assistant > Convert Expression To Keyframes.
19. Select the solid layer's Tracker 1 and Mask 1 property group names.
20. Finally, click the palette's "Apply Mask" button.

The mask vertices will now be animated to match the Nulls. If you change the Null animations, repeat steps 18-20 to update the mask.

Does that help?

Paul


Top
 Profile  
 
 Post subject: Re: Controling individual vertices in a path
PostPosted: Mon Mar 24, 2008 9:54 am 
Offline

Joined: Sun Mar 23, 2008 6:50 am
Posts: 5
Atomic: Thanks for the link.

Paul Tuersley: Thanks, that works great. :)


Top
 Profile  
 
 Post subject: Re: Controling individual vertices in a path
PostPosted: Mon Mar 24, 2008 4:55 pm 
Offline

Joined: Mon Nov 27, 2006 11:08 pm
Posts: 94
Location: Los Angeles, CA
Wow, thats a great workaround for being able to apply and positional data you want to a mask! Thanks Paul!!

_________________
if it's not fun, what's the point?
http://www.mackdadd.com


Top
 Profile  
 
 Post subject: Re: Controling individual vertices in a path
PostPosted: Thu Mar 27, 2008 6:25 am 
Offline

Joined: Sun Mar 23, 2008 6:50 am
Posts: 5
Paul: Any idea how to avoid memory problems? I have a 32 point mask, animated over 1 minute. The problem is that when i try to apply the mask i always get the memory shortage error (it only uses RAM, not disc cache?), when i try to make a segment long more than about 1 second. Any solutions?

This is what i'm making if anyone is curious:
http://shrani.si/f/2X/qY/1deo9Ed4/house4.avi


Top
 Profile  
 
 Post subject: Re: Controling individual vertices in a path
PostPosted: Thu Mar 27, 2008 3:38 pm 
Offline

Joined: Sat Jun 05, 2004 7:59 am
Posts: 645
Location: London, UK
I tried it myself with a 32 point mask over 1000 frames, on an Intel Mac with 2GB RAM. Curiously it worked ok on AE7 (running under Rosetta PPC emulation), but crashed AE CS3 8.0.2.

I think the problem may be caused by the script's use of app.beginUndoGroup (which groups all changes into a single undo), so I've removed that. I've also made it read the result of expressions on the trackers, so if you're doing the steps above, you no longer need to "Convert Expression To Keyframes".
Download RotAE1.2.zip

Let me know if it solves your problem and I'll post it on the main thread.

Paul


Top
 Profile  
 
 Post subject: Re: Controling individual vertices in a path
PostPosted: Thu Mar 27, 2008 6:50 pm 
Offline

Joined: Sun Mar 23, 2008 6:50 am
Posts: 5
Thanks Paul. Works like a charm. The processing time is a bit long, but i guess its simply the nature of the script. Haven't tried the expression value read yet, but it sounds great.

Great work!


Top
 Profile  
 
 Post subject: Re: Controling individual vertices in a path
PostPosted: Tue Jun 10, 2008 3:00 pm 
Offline

Joined: Sat Jun 05, 2004 7:59 am
Posts: 645
Location: London, UK
I've posted an update on the original thread that properly fixes the memory issue. It's probably a bit faster too.
Rototracking palette for AE (6.5, 7, CS3)

Paul


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group