Activity › Forums › Adobe After Effects › How can i randomly change a mask/path shape.
-
How can i randomly change a mask/path shape.
Posted by Manorgel on November 11, 2006 at 9:15 amHi,
I was wondering if there’s a way to use expressions to randomly change a mask/path’s shape.
For example, a curvilinear line, thats lets say has a shape of a snake, and it is slightly winding randomly.
I know there several ways to do this manually, but i was wondering if it was possible to randomize a change in the points’ positions on a curve.
Thanks you,
M.
Jacob Tamari replied 12 years, 4 months ago 6 Members · 5 Replies -
5 Replies
-
Iancorey
November 11, 2006 at 8:20 pmDoesn’t sound like “random change” if you want it to maintain a specific shape. Random shape is where you have no control of whether it turns into a square or a circle or a blob or a snake.
If you’re really doing that snake thing, you should animate a single, thick stroke on the layer ABOVE the media and then use a reverse-alpha track matte (F4) to reveal the media.
-
Mike Clasby
November 12, 2006 at 10:42 pmYes, you can, but it’s a little roundabout. You’ll need a Script, trackpoints, and the wiggle expression.
But are you just trying to move a line like a snakes wiggle? If you just stroke a straight line and apply the effect Distort> Wave Warp, very controllable.
But if you want to move the vertices of a mask randomly, here’s the Script:
https://del.icio.us/escruz/Rotoscope
Download, then move the jsx file RotAE.jsx to AE’s Script Folder, then open AE.
Draw your mask, I used a 4 point mask to get what I thought was the minimum to get your winding motion. The mask is pretty straight as the animation of the vertices will make it like a side winder.
Select the layer with the Mask, then, File>Run Script>RotAE.jsx
Select the Mask, then in the control panel that popped up, “Apply Tracker”, and you’ll have Tracker 1 with 4 Tackpoints for the layer, you’ll as many track points as you have mask vertices.
Now apply a wiggle expression to each of the 4 tracker Attach Points, first copy the expression, then twirl down the track Point, and Alt Clicking the Attach Pint Stopwatch, then pasting the expression in:
wiggle (5, 50)
Do this for each of the 4 (or more) track points.
Now Select all the Attach Point, then Animation>Keyframe Assistant>Convert Expression To Keyframes. The Script Panel needs keyframes to apply the mask to.
Now select the Tracker 1 (above the 4 mask points) and select the Mask, then up in the Script’s Control panel, click ” Apply Mask”. You should have a mask shape with all the vertices having a wiggle or (5,50). In case your new to wiggle, 5 is the Frequency (how many times per sec) and 50 is the Amplitude (amount of wiggle), change these in the earlier step to change the wiggle. You could have also keyframed the movement by hand, or paste in position keyframes, or Motion Sketch, any method you want, to get keyframes, so they can be applied to the mask vertices above.
-
Adam Mercado
February 1, 2007 at 10:32 pmchhers mike, this looks about as complex as I expected. But about time I got me into some scripting. Thanks for the tip…
mm66
-
Henk Loorbach
October 8, 2009 at 11:45 amanother proof that creative cow forums rock!! i was googling and found this, exactly what i was looking for.
thanks!!
Henk
Reply to this Discussion! Login or Sign Up