Copy link to clipboard
Copied
I want to make a mask that references a path elsewhere.
But after I whip linked it, the position of the mask is off.
I tried to use expression to move the points of the mask path, except I cant find the proper function to do that.
Im new and self taught, help.
Shape layers can be weird as they have two sets of coordinates (sort of). There's the corrdinates of the shape layer itself, then each shape in a layer has its own transform points. That's my guess as to why the position is not aligned.
The challenge you've sound interesting, but it might be there's an easier way to tackle it. I'm guessing again, but are you trying to use a mask to only show part of a layer? Track Mattes might be a simpler approach. You can use the shape layer to cut out
...Copy link to clipboard
Copied
Shape layers can be weird as they have two sets of coordinates (sort of). There's the corrdinates of the shape layer itself, then each shape in a layer has its own transform points. That's my guess as to why the position is not aligned.
The challenge you've sound interesting, but it might be there's an easier way to tackle it. I'm guessing again, but are you trying to use a mask to only show part of a layer? Track Mattes might be a simpler approach. You can use the shape layer to cut out the section of a layer below.
Copy link to clipboard
Copied
Yea, I worked around the issue with Mattes.
For those who are interested, my later experimentations in using expressions worked when I modified to this:
mask1=thisComp.layer("Shape Layer 1").content("Shape 1").content("Path 1").path;
//transform
newmask=[];
for (i=0; i<mask1.points().length;i++){
offsetX=thisComp.layer("Controller").effect("Slider Control")("Slider");
offsetY=thisComp.layer("Controller").effect("Slider Control 2")("Slider");
value = mask1.points()[i];
value=value+[offsetX,offsetY];
newmask.push(value);
}
//create path
mymask=mask("Mask 1").path;
mymask=createPath(newmask,mask1.inTangents(),mask1.outTangents(),true);