Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Linking a mask path to a shape path in different layer

  • Linking a mask path to a shape path in different layer

    Posted by Martins Roc on February 5, 2020 at 3:27 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?

    Alex Printz replied 6 years, 2 months ago 2 Members · 1 Reply
  • 1 Reply
  • Alex Printz

    February 5, 2020 at 7:23 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 < 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

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy