Activity › Forums › Adobe After Effects Expressions › Mask points
-
Mask points
Posted by Rich Seemueller on June 12, 2008 at 6:06 pmIs there a way to map out the points of a mask into an array so that I can add an expression to them individually?
Rich Seemueller
Motion Graphics/DS Editor
Guardian Studios | WSFJ | Dot2 NetworkBrad Pickford replied 14 years, 8 months ago 5 Members · 5 Replies -
5 Replies
-
Dan Ebberts
June 12, 2008 at 6:15 pmNo. But depending on what you’re trying to do, you may be able to create a work-around by using a script, which does have access to mask data.
Dan
-
Rich Seemueller
June 12, 2008 at 6:21 pmI’ve created an element in Illustrator which I’m trying to animate 2 mask points with random motion. I was just going to use a wiggle expression, but I need to keep it to only 2 of the points.
-
Mike Clasby
June 12, 2008 at 7:03 pmYou can do it by applying an expression (wiggle) to mask the vertices. Three options below:
1) I just tried a new (to me) Script, “maskPointsExpression.jsx”. It works a charm. You can get it here:
https://www.nabscripts.com/Downloads/downloads_en_2.php?id=7
Demo on the page has little vid demo, I saw that after I typed the following walk-through, oh, well, details follow:
Add “maskPointsExpression.jsx” to your AE Scripts Folder, then fire up AE.
Run>Script>maskPointsExpression. Then select your mask,
Click on “Calculate” (it puts up a number equaling the vertices
Click on Custom (to apply expression to only one mask point) ,.
Click the Display Num radio button, so you can see which mask points to wiggle.
Type the number of the mask point you want to wiggle in the box below “Custom” and “All”.
Click “Position”, write your wiggle expression in the box:
wiggle(15,20) ;//use own your wiggle expression
Anyway, it creates a new mask, named “Animated mask” with the keyframes determined by the expression.
To get two mask points with a wiggle expression, select that new mask, “Animated Mask”, and do the above procedure, but for mask point 2, if that’s the other onw you want to wiggle. Now when you click OK, you get another new mask, also named Animated Mask, wit two points wiggling.
Pretty slick.
There may be a way to do separate wiggle expressions on two different verticies at the same time, but I can’t noodle that out in a quick test.
Be forewarned, trim footage to only as long as you needed, I had a 30 second clip in a 4 sec comp, yet it calculated the keyframes for all 30 sec, taking a long time (5 minutes plus). After trimming the clip, it knocked it right out.
2) There is an earlier script, written for Roto work, that attaches mask vertices to track point keyframes (and you can write expressions for the Track Points, then Convert to keyframes). It works but is a longer work around, an earlier post, here:
https://forums.creativecow.net/readpost/2/891545
It’s a great script for roto, but I think the first one is easier for putting expressions on a mask.
3) Also, crgreen has a script that should do what you want, but I haven’t really used it. It too would probably be a two-step process, like with the script above. The script is named “Connect_Vertex_to_Point.jsx” and is here:
https://www.crgreen.com/aescripts/ie/
-
Jim Lefevre
July 4, 2008 at 3:00 pmOh lordy! This might be something I’ve been looking for although from the other way round. I’m just following through on all of your suggestions Mike so in the meantime I might stumble upon a solution but…
I’ve got a three pointed mask/path I’m using to make an arm on a character (it is then ‘stroked’ to make a solid arm) and I’m trying to find a way where I can take the information from the three vertices (which are basically the hand, elbow and shoulder) and use that information to be able to automatically position a texture which I then use ‘underneath’ and revealed by the stroked arm….
Shall explore and experiment although this is literally the first time I have used expressions or presets!!!
Thanks for the useful information!
Jim
http://www.nexusproductions.com
-
Brad Pickford
August 16, 2011 at 12:21 pmHi Jim,Did you ever find a solution to this. I am trying to do something similar, by parenting a object to one of the vertices in a mask.
Cheers,
Brad
Reply to this Discussion! Login or Sign Up