Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Trying to set new position of mask path vertices via script

  • Trying to set new position of mask path vertices via script

    Posted by Anton Shushar on July 21, 2019 at 10:53 am

    I’m using this code:

    var comp = app.project.activeItem;
    var selLayer = comp.selectedLayers;
    var myMask = selLayer[0].property("ADBE Mask Parade").property("ADBE Mask Atom").property("ADBE Mask Shape");
    myMask.setValue([[0,0], [0,1], [1,1], [1,0]])

    However, for some reason it doesn’t work, AE throws me an error. Could you tell me what I’m doing wrong?

    Dan Ebberts replied 7 years ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    July 21, 2019 at 1:17 pm

    Try replacing your last line with this:

    var myPath = myMask.value;
    myPath.vertices = [[0,0], [0,1], [1,1], [1,0]];
    myMask.setValue(myPath);

    Dan

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy