Skip to main content
Participant
January 22, 2020
Answered

Track each line shape points to different 3d Tracked points in a video

  • January 22, 2020
  • 2 replies
  • 512 views

Hi!

I need to create a path running on a video of a mountain excursion.
I tracked the video but now I would need to create a line that follow different points of the tracking I have.
Is there an expression to link each points of a line shape to different null objects created from the tracked points that I chose in order to have the line tracked to video?

 

Attached you can see a first try I died but result is not good.

 

Thank you

This topic has been closed for replies.
Correct answer Rick Gerard

If you have the budget Lockdown is the best solution to your problem. 

 

If you don't have that you will have to run Camera Tracker, set an origin and ground plane somewher4e around basecamp, then add a bunch of other planes everywhere you want a bezier point. Once you have all of those planes loaded into the comp you'll have to add a shape layer to the comp and create a path with as many points on it as you have tracker solids. If you have added 15 tracker solids, you need 15 points on your path. Then it is time to go to Window>Create Nulls From Paths.jsx and use the Points follow Nulls option to attach a null to every bezier point.

 

Now comes the fun part. You will need an expression to tie the position of each null to the 3D position of each solid and you'll have to do that in order. The easiest thing to do is to drag all of the Track Solid layers just above their appropriate null then add and expression. The expression would look like this:

 

 

 

L = thisComp.layer(index - 1);
L.toComp([50,50,0]);

 

 

 

The toComp(value) is set to 50, 50, 0 to move the anchor point of the null to the center of the layer so that the null will line up properly with your Tracker Solids. I hope this makes sense. 

 

You will have to draw your path close to the final path at several points in timeline so that the bezier handles are close to where they need to be. This is pretty easy if you add the first two or three points on the first frame, then move forward in time until the last track solid you used for reference is out of frame, then draw the next section of the path. When you are done organize the layers and add the expressions to the position property of each null.

 

I hope this makes sense. If I get a minute I'll try and add a screenshot so you can see how it would work.

 

The other option would motion stabilize the shot using scale and rotation so that the ground doesn't move. Then you can apply an expression to a null that ties the anchor point of the stabilized layer to the position of the null, then do and opposite rotation and fix the scale (a little complicated to explain here). This will give you a stable image so you can draw a path using a shape layer. If you then parent the stabilized footage and the shape layer to the null the motion will be added to the shape layer and the stabilization will be removed from the footage.

 

There is also an option to use Mocha AE to do some surface tracking and then add in CC Power Pin to get you a stabilized section of the mountain that you can use to draw a path. 

 

2 replies

Rick GerardCommunity ExpertCorrect answer
Community Expert
January 22, 2020

If you have the budget Lockdown is the best solution to your problem. 

 

If you don't have that you will have to run Camera Tracker, set an origin and ground plane somewher4e around basecamp, then add a bunch of other planes everywhere you want a bezier point. Once you have all of those planes loaded into the comp you'll have to add a shape layer to the comp and create a path with as many points on it as you have tracker solids. If you have added 15 tracker solids, you need 15 points on your path. Then it is time to go to Window>Create Nulls From Paths.jsx and use the Points follow Nulls option to attach a null to every bezier point.

 

Now comes the fun part. You will need an expression to tie the position of each null to the 3D position of each solid and you'll have to do that in order. The easiest thing to do is to drag all of the Track Solid layers just above their appropriate null then add and expression. The expression would look like this:

 

 

 

L = thisComp.layer(index - 1);
L.toComp([50,50,0]);

 

 

 

The toComp(value) is set to 50, 50, 0 to move the anchor point of the null to the center of the layer so that the null will line up properly with your Tracker Solids. I hope this makes sense. 

 

You will have to draw your path close to the final path at several points in timeline so that the bezier handles are close to where they need to be. This is pretty easy if you add the first two or three points on the first frame, then move forward in time until the last track solid you used for reference is out of frame, then draw the next section of the path. When you are done organize the layers and add the expressions to the position property of each null.

 

I hope this makes sense. If I get a minute I'll try and add a screenshot so you can see how it would work.

 

The other option would motion stabilize the shot using scale and rotation so that the ground doesn't move. Then you can apply an expression to a null that ties the anchor point of the stabilized layer to the position of the null, then do and opposite rotation and fix the scale (a little complicated to explain here). This will give you a stable image so you can draw a path using a shape layer. If you then parent the stabilized footage and the shape layer to the null the motion will be added to the shape layer and the stabilization will be removed from the footage.

 

There is also an option to use Mocha AE to do some surface tracking and then add in CC Power Pin to get you a stabilized section of the mountain that you can use to draw a path. 

 

Luca_KFDSAuthor
Participant
January 23, 2020

Hi Rick!
Thank you for your suggests.

Unfortunately I can't buy Lockdown for this project but I'll keep it in mind for the future. It seems great!

I had to close the project simplifying the path with few points and their movements.

I'll try your solution as soon as I can because I think it could be useful for other works.

Thank you again!

Mylenium
Legend
January 22, 2020

Use the various "create expression Null" functions/ scripts found in the menu to create Nulls linked to mask and shape layer paths and then apply the tracking data to the nulls. Otherwise stitching together the path with multiple instances of the good old Beam effect would be another alternative, assuming the segments are just straight.

 

Mylenium

Luca_KFDSAuthor
Participant
January 22, 2020

The problem is that the line has not be straight but bezier.
Sorry but I didn't understand how I can control each point of my shape "linking" them to Nulls object I would create using 3d tracked points.