Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects maskFeather property in a script

  • maskFeather property in a script

    Posted by Nicolas Elsig on May 8, 2010 at 10:43 pm

    Hello,

    can somebody tell me if it’s possible to control the maskFeather of a creted mask … I tried some different ways, but can’t find the solution

    thanks a lot

    newLayer = currentComp.layers.addSolid([0,1.0,0], newName, size, size, 1);
    newLayer.name = newName;
    newMask = newLayer.Masks.addProperty("Mask");
    newMask.inverted = false;
    myMaskShape = newMask.property("maskShape");
    myShape = myMaskShape.value;
    myShape.vertices = [[size*0.25,size*0.25],[size*0.25,size*0.75],[size*0.75,size*0.75],[size*0.75,size*0.25]];
    myShape.closed = true;
    myMaskFeather = newMask.property("maskFeather");
    myMaskFeather = 15;
    myMaskShape.setValue(myShape);

    Dan Fredley replied 14 years ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Fredley

    July 31, 2012 at 5:00 pm

    For any future scripters looking for the solution to this problem, you need to use the .setValue([array of numbers]) method instead of a simple number assignment since there are two dimensions.

    {
    proj = app.project;
    comp = proj.activeItem;
    newName = "blah";
    size = 100;
    newLayer = comp.layers.addSolid([0,1.0,0], newName, size, size, 1);
    newLayer.name = newName;
    newMask = newLayer.Masks.addProperty("Mask");
    newMask.inverted = false;
    myMaskShape = newMask.property("maskShape");
    myShape = myMaskShape.value;
    myShape.vertices = [[size*0.25,size*0.25],[size*0.25,size*0.75],[size*0.75,size*0.75],[size*0.75,size*0.25]];
    myShape.closed = true;
    myMaskFeather = newMask.property("maskFeather");
    myMaskFeather.setValue([15,15]);
    myMaskShape.setValue(myShape);
    }

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