ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

mask points following absolute coordinates of a shape layer's path vertex

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Peter Zeet
mask points following absolute coordinates of a shape layer's path vertex
on Sep 24, 2019 at 12:41:22 am

HI!
sorry if this has been posted before (I was sure to have read something related in the past), I tried to find it, but had no luck.

So, I need to link a mask path to a shape path in the same layer, and all ok except when the shape path's transform position or anchor point is not [0,0].

is it possible to get rid of that offseting, so the mask is always placed where the path is in absolute coordinates?

right now I had the simplest
thisLayer.content("The Path").content("Path 1").path;
expression into the mask's path, until I had to work with non [0,0] positioned path

thanks in advance, and sorry to repeat if this is answered on an old thread


Return to posts index

Dan Ebberts
Re: mask points following absolute coordinates of a shape layer's path vertex
on Sep 24, 2019 at 6:08:14 pm

Try this:


p = thisLayer.content("The Path").content("Path 1").path;
v = [];
pts = p.points();
for (i = 0; i < pts.length; i++){
v.push(toComp(pts[i]));
}
createPath(v,p.inTangents(),p.outTangents(),p.isClosed());



Dan



Return to posts index

Peter Zeet
Re: mask points following absolute coordinates of a shape layer's path vertex
on Sep 24, 2019 at 7:05:41 pm

hi!
thanks for the response!

but it seems there is something weird happening, the mask is only at the correct position if the anchor point of the layer and the anchor point of the path shape group are the same (*-1) and the layer positio is twice the anchor point value, once you move from that position or change any other value (shape group's position or anchor point), the mask position starts offseting a lot. It's like having a weird parallax effect if you move from their absolute center


Return to posts index

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