ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

getting mask points x and y values

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
nadav rock
getting mask points x and y values
on Oct 2, 2017 at 5:36:53 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.


Return to posts index

Dan Ebberts
Re: getting mask points x and y values
on Oct 2, 2017 at 6:48:03 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



Return to posts index

nadav rock
Re: getting mask points x and y values
on Oct 5, 2017 at 3:02:18 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();
}


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]