Page 1 of 1

Creating an ellipse mask by hand

Posted: November 4th, 2012, 6:16 pm
by cswaim
Hi, first time poster to aenhancers.com! Excited to get discussions and feedback on this question.

I'm writing a script to automate creating a custom vignette in a stylized way I use a lot. I've gotten it to create the solid, add the mask with proper vertices, and change the mask mode to Subtract. I've also been able to create the ellipse with the proper inTangents and outTangents from page 173 of the scripting guide:

-----------------------

Example: Create an oval
An oval is a closed shape with 4 vertices and with inTangent and outTangent values:

var myShape = new Shape();
myShape.vertices = [[300,50],[200,150],[300,250],[400,150]];
myShape.inTangents = [[55.23,0],[0,-55.23],[-55.23,0],[0,55.23]];
myShape.outTangents = [[-55.23,0],[0,55.23],[55.23,0],[0,-55.23]];
myShape.closed = true;

-----------------------

And did some research here to re-write it to work for any comp size: http://www.aenhancers.com/viewtopic.php ... lit=circle.

My question is this: what is the significance of the 55.23? Where do they get that value...is it calculated or is it just some contant when dealing with ellipses?

I'm shifting over from a software engineering background heavy in javascript, but it's the math/geometry that's caught me up now. Thanks so much!

Re: Creating an ellipse mask by hand

Posted: November 6th, 2012, 3:00 am
by Paul Tuersley
My guess would be it's the offset in pixels from the vertices to the tangent handle.