Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Path property Expression to offset the path

  • Path property Expression to offset the path

    Posted by Dániel Ország on January 14, 2024 at 7:23 pm

    So i have this expression for thePathproperty in aShape Group.

    // Get the path from the Shape layer in the composition
    var shapeLayer = thisComp.layer(“Shape Layer Name”);
    var shapeGroup = shapeLayer.content(“Shape Group Name”);
    var path = shapeGroup.content(“Path Name”).path;

    // Get path properties
    var pts = path.points();
    var inTans = path.inTangents();
    var outTans = path.outTangents();
    var closed = path.isClosed();

    // Move the path vertices 500 pixels to the right
    for (var i = 0; i < pts.length; i++) {
    pts[i][0] += 500; // Add 500 to the x-coordinate
    }

    // Create a new path with modified vertices
    createPath(pts, inTans, outTans, closed);

    It moves the path 500 pixel to the right. Only the path itself without touching the transform controls (postion etc..)

    My issue is that i have to manually type the Shape Layer, Shape Group and Path name to make it work.
    I can’t figure it out how to make this expression work in a way to automatically recognise this hierarchy within the Shape Layer.

    its something like ADBE Root Vectors Group, ADBE Vectors Group, ADBE Vector Shape.

    Can anyone help? thx

    Dániel Ország replied 2 years, 6 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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