Skip to main content
Participant
March 5, 2026
Answered

retreive path points of a shape

  • March 5, 2026
  • 1 reply
  • 45 views

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 ?

    Correct answer Dan Ebberts

    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;

     

    1 reply

    BubarnetAuthor
    Participant
    March 6, 2026

    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.

    Dan Ebberts
    Community Expert
    Dan EbbertsCommunity ExpertCorrect answer
    Community Expert
    March 6, 2026

    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;

     

    BubarnetAuthor
    Participant
    March 6, 2026

    THANK YOU!

     

    It works! It was driving me crazy!

     

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