Okay, so you’re creating an After Effects script (my condolences to you, by the way) to create a mask or a shape layer. And you want to create an *open* mask. And you’ve been banging your head against a brick wall, because the damn thing always wants to close. Here’s how to fix it…

The trick seems to be to declare the mask to be open *before* you set the points of the mask. So simple when you know how. So, this will not work:

newMask = thisLayer.Masks.addProperty("Mask");
myMaskShape = newMask.property("maskShape");
myShape = myMaskShape.value;
myShape.vertices = maskPointArray;
myMaskShape.setValue(myShape);
myShape.closed = false;

Whereas this *will* work:

newMask = thisLayer.Masks.addProperty("Mask");
myMaskShape = newMask.property("maskShape");
myShape = myMaskShape.value;
myShape.vertices = maskPointArray;
myShape.closed = false;
myMaskShape.setValue(myShape);

I thought i’d write this up to hopefully save someone the same frustration i’ve been through.