ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Trying to set new position of mask path vertices via script

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Anton Shushar
Trying to set new position of mask path vertices via script
on Jul 21, 2019 at 10:53:28 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?


Return to posts index

Dan Ebberts
Re: Trying to set new position of mask path vertices via script
on Jul 21, 2019 at 1:17:45 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



Return to posts index

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