Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions getting mask points x and y values

  • getting mask points x and y values

    Posted by Nadav Rock on October 2, 2017 at 5:36 pm

    is there a way to get the x and y values of a mask at different times and make extend write them to another file? my purpose is to say take a position vector. extract the x and y path along which it moves. write it to a differnt document. and then always have it at my disposal to apply at a click.

    Nadav Rock replied 8 years, 10 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    October 2, 2017 at 6:48 pm

    I think the answer to your question is yes, there is a way to access mask points (vertices and tangents) and a way to write data files with AE scripting. I hope that’s helpful.

    Dan

  • Nadav Rock

    October 5, 2017 at 3:02 am

    solved using code

    var preExpression = true;
    var xy = app.project.item(3).layer(1).transform.position.valueAtTime(1, preExpression); // returns an array of 2 or 3 [x,y,z]
    var xy2 = app.project.item(3).layer(1).transform.position.valueAtTime(2, preExpression); // returns an array of 2 or 3 [x,y,z]
    var xy3 = app.project.item(3).layer(1).transform.position.valueAtTime(3, preExpression); // returns an array of 2 or 3 [x,y,z]
    var xy4 = app.project.item(3).layer(1).transform.position.valueAtTime(4, preExpression); // returns an array of 2 or 3 [x,y,z]
    var xy5 = app.project.item(3).layer(1).transform.position.valueAtTime(5, preExpression); // returns an array of 2 or 3 [x,y,z]
    var xy6 = app.project.item(3).layer(1).transform.position.valueAtTime(6, preExpression); // returns an array of 2 or 3 [x,y,z]
    var xy7 = app.project.item(3).layer(1).transform.position.valueAtTime(7, preExpression); // returns an array of 2 or 3 [x,y,z]
    var xy8 = app.project.item(3).layer(1).transform.position.valueAtTime(8, preExpression); // returns an array of 2 or 3 [x,y,z]
    var xy9 = app.project.item(3).layer(1).transform.position.valueAtTime(9, preExpression); // returns an array of 2 or 3 [x,y,z]
    var xy10 = app.project.item(3).layer(1).transform.position.valueAtTime(10, preExpression); // returns an array of 2 or 3 [x,y,z]

    var randomname = Number(new Date());
    var filepath = “~/Desktop/” + randomname + “.txt”;
    var outfile = File(filepath);
    outfile.open(‘a’);
    if (outfile !== ”) {
    outfile.writeln(xy);
    outfile.writeln(xy2);
    outfile.writeln(xy3);
    outfile.writeln(xy4);
    outfile.writeln(xy5);
    outfile.writeln(xy6);
    outfile.writeln(xy7);
    outfile.writeln(xy8);
    outfile.writeln(xy9);
    outfile.writeln(xy10);
    outfile.close();
    }

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