ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

createPath and toWorld?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Santi Agustí
createPath and toWorld?
on Jun 29, 2019 at 5:11:17 pm

Hi!
I'm trying to create a shape path which follows a mask path from another layer.
All ok if doing the simplest
thisComp.layer("Black Solid 1").mask("Mask 1").maskPath

But if the Black Solid 1 is animated, or rotated, repositioned, parented, etc the shape path is not following these transformation info

Do you know if there is a way to make a toComp to the maskPath in order to get the asbsolute values, so we always have the same shape Path (visually) as the maskPath no matter the Black Solid 1 transforms? (and even more, keeping the maskPath animation vertex keyframe data too)

I tried to redraw the shape using the createPath method


N = thisComp.layer("Black Solid 1");
maske=N.mask("Mask 1").maskPath;
points=maske.points();
inTangents = maske.inTangents();
outTangents = maske.outTangents();
isClosed = maske.isClosed();
createPath(points, inTangents, outTangents, isClosed)


is that possible to use something like N.toWorld etc etc to make it work?
Do you think is that way is possible somehow?

thanks!


Return to posts index

Dan Ebberts
Re: createPath and toWorld?
on Jun 29, 2019 at 7:46:32 pm

Play around with this:


N = thisComp.layer("Black Solid 1");
maske=N.mask("Mask 1").maskPath;
points=maske.points();
points2 = [];
for (i = 0; i < points.length; i++){
points2.push(fromComp(N.toComp(points[i])));
}
inTangents = maske.inTangents();
outTangents = maske.outTangents();
isClosed = maske.isClosed();
createPath(points2, inTangents, outTangents, isClosed)



Dan



Return to posts index

Santi Agustí
Re: createPath and toWorld?
on Jun 29, 2019 at 8:24:06 pm

thank you!!!
this is gold!!


Return to posts index

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