Hi All,
I am trying to automate a process and I need to create an animated mask on every layer I import.
I don't know if this is possible, but is there a way to create a mask using JSX? If so, how do I animate it?
Thanks
Create an Animated Mask For a Layer
Moderator: byronnash
"Up And Atom
No...No
Up And At Them!"
No...No
Up And At Them!"
Hmmm, almost.
Does anyone know what the code syntax is for animating the mask?
Here is position, what is the equivalent for mask verticies?
Thanks!
Code: Select all
// create square mask
var newMask = mySolid.Masks.addProperty("Mask");
newMask.inverted = true;
var myMaskShape = newMask.property("maskShape");
var myShape = myMaskShape.value;
myShape.vertices = [[5,5],[5,45],[45,45],[45,5]];
myShape.closed = true;
myMaskShape.setValue(myShape);
Code: Select all
myPosition.setValueAtTime(4,[80,30]);
Thanks!
"Up And Atom
No...No
Up And At Them!"
No...No
Up And At Them!"
more experimenting has lead to this.
It looks like setValueAtTime is all you need.
Code: Select all
myShape.vertices = [[0,0],[w,0],[w,h],[0,h]];
myShape.closed = true;
myMaskShape.setValueAtTime(0,myShape);
offset = 50;
myShape.vertices = [[0+offset,0],[w+offset,0],[w+offset,h],[0+offset,h]];
myShape.closed = true;
myMaskShape.setValueAtTime(1,myShape);
"Up And Atom
No...No
Up And At Them!"
No...No
Up And At Them!"