Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions createPath and toWorld?

  • createPath and toWorld?

    Posted by Santi Agustí on June 29, 2019 at 5:11 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!

    Santi Agustí replied 6 years, 10 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    June 29, 2019 at 7:46 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

  • Santi Agustí

    June 29, 2019 at 8:24 pm

    thank you!!!
    this is gold!!

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