Activity › Forums › Adobe After Effects › adress single points of masks?
-
adress single points of masks?
Posted by Lars Mylius on January 8, 2008 at 4:53 pmhello there
is there a way to adress single points in masks?
this could be useful for example if I use a stroked path as an arm so i could parent one point to the hand and one point to the body…thank you!
larsYaz Rabadi replied 16 years, 6 months ago 4 Members · 5 Replies -
5 Replies
-
Mike Clasby
January 8, 2008 at 8:18 pmThere are two scripts to do what you want, but both require that expression to be converted to mask shape keyframes in the process. I think the rotoScript in 1) is what you need, assuming there will be more than two vertices in your mask that will be stroked. The second method has a limitation of one vertice or all vertices, but if the stroked mask is on the layer named Body and you assign an expression to vertice 2 for the Hand it should work.
1) Here is a script to apply a mask to data, it was written for roto work, but you can use it to apply expressions to mask points.
Overview:
1-The script assigns Tacking Points to mask vertices.
2-Put an expression on the tack point (Attach Point really) that corresponds to the body part you want to tie it to.
3-Convert the expression to keyframes, sorry but it needs keyframes to work so all animation needs to be done first.
4-Apply the Tracker to the mask.
Done.Details:
https://del.icio.us/escruz/Rotoscope
Download, then move the jsx file RotAE.jsx to AE’s Script Folder, then open AE.
Assuming three body parts, named Body, Arm and Hand, that are already animated.
Draw your three point mask (just do two points if that’s it). I drew the mask on a Solid named Stroke.
File>Run Script> RotAE.jsx
Select the mask, then in the script palette, click “Apply Tracker”
And it will create Tracker one with three track points.Twirl down the Tracker 1 > Track Point To the Attach Point, say the one corresponding to Body, add this expression (Copy the expression, Alt-Click the Attach Point Stopwatch, Paste, click outside the box):
thisComp.layer(“Body”).position
You can also write this expression automatically by Alt-clicking the Attach Point Stopwatch then pickwhipping (looks like an asterisk, middle of three little boxes) to the layer named Body’s Position stopwatch.
Then you’ll need to select the track point 2, attach point 2, and add this expression:
thisComp.layer(“Arm”).position
And for track point 3/attach point 3:
thisComp.layer(“Hand”).position
Then select the three expression, all three Attach Points next to their equal signs(meaning they have an expression applied) and from the Animation menu above select, Animation>Keyframe Assistant>Convert Expression to Keyframes.
Then select Tracker 1 (not the track points) AND select the mask, then in the rot script palette, click “Apply Mask”.
That should do it.
It will also work for just two mask points, or as many as you want.
2) There is a script for applying expressions to mask vertices, but it’s for all vertices of for a single vertice; here is an earlier post:
https://forums.creativecow.net/readpost/2/915452
Another limitation to this is that it looks like the Body layer needs to be the same size as the comp so the calculations can be done, meaning you’d need to mask out a comp sized layer or precomp the Body onto a comp sized layer, getting a bit complicated now… yikes.
If you’re only talking two points you could make it work by having the mask on say the Body layer then applying an expression to vertice 2:
thisComp.layer(“Hand”).position
But anymore than two vertices and it wouldn’t work as the script can only access one vertice or all vertices.
To apply to a specific vertice, follow the links instructions until you click Calculate (to give you the number of mask points, vertices), then click Selection>Custom (since we want individual points), click the “display num” radio button (so you can see which vertice is which) and in the box above type “2” so the expression will apply to the 2nd vertice. In the left column, click the “Position expression” radio button, and type into the box below the expression to tie that vertice to the layer named “Hand”, something like this for the expression:
thisComp.layer(“Hand”).position
That’s assuming you hand layer is named “Hand”.
So the mask will be on the Body layer, hence vertice one will follow that, and vertice two will be tied to the hand.
-
Lars Mylius
January 8, 2008 at 8:41 pmwow!
that is a lot of information and not exactely shallow… so being pretty new to scripting I will need a few days to work through but so far it makes sense to me and I think, this will do.thank you so much!
all the best
lars -
Christopher R. green
January 9, 2008 at 7:34 amand of course, if you like the interface, there is my connect mask vertex to point script at:
https://www.crgreen.com/aescripts/actual_scripts/Connect_Vertex_to_Point.jsx -
Lars Mylius
January 10, 2008 at 5:20 amwow again… I am still not quite through the other suggestions – partly because I am currently working out of buenos aires and it is simply too hot… but I will be back at my desk in freezy berlin next week and go through.
thank you so much – I will let you know how I got along.
all the best
lars -
Yaz Rabadi
November 13, 2009 at 12:20 amI’m looking to track masks with RotAE, but I’m having some issues. I have two people sitting near a window. I’m looking to create a mask around their faces, so I can have rain falling on the window.
I create the mask between the two faces which covers the window – and set it to Subtract. Select the mask and open RotAE. From there, with the mask selected, I click on Apply Tracker.
Here’s where the issues start. For some reason when I press the play button to Track the points, four or five points automatically just move to the middle of the window.
Occasionally this problem happens later when I Apply Mask with the Mask and Tracker selected.
I’m not sure what the issues is… Could it be that I have too many points? Or maybe that I’m not selecting things that are clearly trackable? But still, the points just move right to the centre. It’s usually the first few points and the last few points that do this.
Please, someone HELP!!!
Thank you,
Yaz
Reply to this Discussion! Login or Sign Up