Skip to main content
Participant
Mar 5, 2026 5:46 PM UTC
Answered

retreive path points of a shape

Hello

 

I have a shape layer with only one path. I would like to retreive the points of the path

 

My layer :

“Arrow”

|_Content

  |_”CArrow”

    |_”CPath”

      |_Path

 

My code


    comp=app.project.activeItem;
    shape=comp.layer("Arrow");

//I try these two possibilities
    sPath=shape.content("CArrow").content("CPath");
    sPath=shape.content("CArrow").content("CPath").path;

//I also try these two possibilities
    sPoints=sPath.points(); //I got an error

    sPoints=sPath.points; //I got “undefined”

 

I don’t understand where is my error. Could someone explain how to retreive points coordinates ?

    Dan Ebberts
    Dan EbbertsCorrect answer
    Community Expert
    Mar 6, 2026 7:13 PM UTC

    The key is that for scripting, you’ll need to use .vertices instead of .points(). I’m not sure how you have things named, but it will probably look like this:

    var comp=app.project.activeItem;
    var shape=comp.layer("Arrow");

    var myPath = shape.property("Contents").property("CArrow").property("Contents").property("Path 1").property("Path").value;
    var myPoints = myPath.vertices;

     

    5 replies

    BubarnetAuthor
    Participant
    Mar 6, 2026 3:10 PM UTC

    Ok I find the problem : 

    This code works well if I write it in a layer (for exeample in a text layer->source text

    thisComp.layer("Arrow").content("CArrow").content("CPath").path.points();

     

    But if I write this in a jsx file

    ----Code---

        var comp = app.project.activeItem; // Récupérer la composition active

        comp.layer("Arrow").content("CArrow").content("CPath").path.points();

    ---End code---

    that I launch by File->scripts->Execute file script (not sur of the name, I’m using a french version of After Effects), it doesn’t work anymore.

    Translate
    Dan Ebberts
    Community Expert
    Dan EbbertsCommunity ExpertCorrect answer
    Community Expert
    Mar 6, 2026 7:13 PM UTC

    The key is that for scripting, you’ll need to use .vertices instead of .points(). I’m not sure how you have things named, but it will probably look like this:

    var comp=app.project.activeItem;
    var shape=comp.layer("Arrow");

    var myPath = shape.property("Contents").property("CArrow").property("Contents").property("Path 1").property("Path").value;
    var myPoints = myPath.vertices;

     

    Translate
    BubarnetAuthor
    Participant
    Mar 6, 2026 7:49 PM UTC

    THANK YOU!

     

    It works! It was driving me crazy!

     

    Why “vertices” instead of “points”? Another mystery of After Effects.

    Translate