Skip to main content
Known Participant
January 17, 2025
Answered

How to determine the range of a motion tracker after execution?

  • January 17, 2025
  • 1 reply
  • 230 views

I have a motion tracker in a project, creating a 'jitter' effect based on the movement of an element on the footage. 

 

How can I determine the maximum extent (x axis and y axis) to which the motion tracker is moving? 

 

The awkward solution I am using is to export the keyframes of that motion tracker into excel and just sort the data points. Is there a better way to do this? I want to know: Transform/Position/ Xmax - Xmin and Transform/Position/ Ymax - Ymin.

Correct answer ShiveringCactus

What's wonderful about the internet is sometimes, it is forever.  Looks like someone asked a similar question in 2008 and this is @Dan Ebberts response:

 

p = transform.position.valueAtTime(inPoint);
minX = p[0];
minY = p[1];
maxX = p[0];
maxY = p[1];

t = inPoint + thisComp.frameDuration;
while (t <= outPoint){ p = transform.position.valueAtTime(t); if(p[0] > maxX) maxX = p[0];
if(p[0] < minX) minX = p[0]; if(p[1] > maxY) maxY = p[1];
if(p[1] < minY) minY = p[1]; t += thisComp.frameDuration; }

[maxX,maxY]

Just tried it and it still works.  I added in the last line, but you could just throw these values to the error bar instead (or to a text layer)

1 reply

ShiveringCactus
Community Expert
ShiveringCactusCommunity ExpertCorrect answer
Community Expert
January 17, 2025

What's wonderful about the internet is sometimes, it is forever.  Looks like someone asked a similar question in 2008 and this is @Dan Ebberts response:

 

p = transform.position.valueAtTime(inPoint);
minX = p[0];
minY = p[1];
maxX = p[0];
maxY = p[1];

t = inPoint + thisComp.frameDuration;
while (t <= outPoint){ p = transform.position.valueAtTime(t); if(p[0] > maxX) maxX = p[0];
if(p[0] < minX) minX = p[0]; if(p[1] > maxY) maxY = p[1];
if(p[1] < minY) minY = p[1]; t += thisComp.frameDuration; }

[maxX,maxY]

Just tried it and it still works.  I added in the last line, but you could just throw these values to the error bar instead (or to a text layer)

paul_7484Author
Known Participant
January 17, 2025

Terriffic, thanks so much. You're a better googler than I am, since you know the terms of art to use. Works like a charm.