Motion trackers positions

What type of scripts do you need?

Moderator: byronnash

Post Reply
User avatar
milkman
Posts: 1
Joined: April 12th, 2019, 8:08 am

April 12th, 2019, 12:13 pm

Hello, everyone!
I`m new to After Effects, so sorry if question if question is stupid. But i`m stuck and Scripting Guide doesn`t help.

I need to extract information about positions of all Motion trackers in each frame. For now i see it that way:

Code: Select all

for (var h=1; h <= app.project.numItems; h++){
    if (app.project.item(h) instanceof CompItem){ 
        for (var i=1; i <= app.project.item(h).numLayers; i++){
            if (/*CHECK if layer is Motion tracker*/){
                var xy = app.project.item(h).layer(i).transform.position.valueAtTime(currTime, preExpression);
            }
        }
    }
}
How can i check if current layer is Motion Tracker?
Maybe there is more convenient way to iterate Motion trackers layers?
Post Reply