ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

maskFeather property in a script

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Nicolas ElsigmaskFeather property in a script
by on May 8, 2010 at 10:43:36 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);


Return to posts index

Dan FredleyRe: maskFeather property in a script
by on Jul 31, 2012 at 5:00:59 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);
}


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]