ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Linking a mask path to a shape path in different layer

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Martins Roc
Linking a mask path to a shape path in different layer
on Feb 5, 2020 at 3:27:35 pm

Hello,

I need to connect a mask path to a shape in another layer.

Simply using the pickwhip generates this expression:
thisComp.layer("circle").content("textfeld").content("Path 1").path

However, the mask shifts to a different position:


Using a track matte is not an option in this case.

How can I modify the expression so that the position of the mask matches the shape path?


Return to posts index

Alex Printz
Re: Linking a mask path to a shape path in different layer
on Feb 5, 2020 at 7:23:49 pm

try this

L = thisComp.layer("circle");
M = thisComp.layer("circle").content("textfeld").content("Path 1").path; // or path!
o = [0,0];

p = hasParent ? thisLayer.parent:thisLayer;

mP = M.points();
mT = M.inTangents();
mO = M.outTangents();
P = []; T = []; O = [];
for(i = 0; i &lt; mP.length; i++){
mPi = mP[i] + o;
P[i] = p.fromComp(L.toComp(mPi));
T[i] = p.fromComp(L.toComp(mPi + mT[i])) - P[i];
O[i] = p.fromComp(L.toComp(mPi + mO[i])) - P[i];
}
createPath(P,T,O,M.isClosed())


Alex Printz
Mograph Designer


Return to posts index

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