Path Property Expression to offset the path
So i have this expression for the Path property in a Shape Group.
// Get the path from the first 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
