CG Jam

Track position node

Whats it for? -Track position node

the track postion node allows us to use tracking data from the motion tracking workspace and apply it to an image in the compositor. Lets see how that works shall we?

Whats it for? Track position.

The track position node is an input node that allows us to transform a value in the compositor according to data supplied by a tracking point in the motion tracking workspace. it is normally used to move an image or movie clip in order to match move it to a movie clip underneath. however, as it gives a value output it can be used to adjust any value as you see fit in the compositor. for example you could use it in the color ramp node to create some funky colour changes, but today we are just going to look at the main functions of the node in its normal context.

track position node

as you can see the node arrives in the compositor with just the x,y and speed outputs and a data block/file browser linked to movie clips, but before we can do anything with this node we have to have the tracking data to use, so our first job is to go into the tracking work space and get that information.


Setting up.

Find the motion tracking workspace from the top info bar and then open up a movie clip from your hard drive. be aware though, this can only be used as a 2d track, which means your image can only be match moved in two directions- up and down. This node can’t affect 3D space so it can’t be made to appear to move towards the camera or appear on an angle or rotate around anything. there are ways of achieving those effects but they are beyond the scope of this guide.


The first job is to scrub through your footage until you find the section of the clip where you  want the effect to appear. you dont need to track the whole clip (unless your going to be adding other elements throughout the clip!) and trim the timeline to cover just those frames. now scrub though the time line and fine the midpoint where the effect will be the most centered and with ctrl pressed down left click your mouse on a trackable element within the frame. this will place a tracking marker on your frame. adjust it so that the tracker is in the right position and then track forward. once your trackable element reaches the edge of the screen then re center it and track backwards so you have the full range of motion tracked.

Offset tracking.

often the thing you are tracking will go off screen as in this clip, the garage door starts and ends off screen, and the tracking data begins after the door has appeared and ends before the door dissapears. so this is a problem as our image that we want to add will appear  stationary on the screen before the door arrives then move along with our tracked point then freeze at the other side of the screen where our track ends, while the door carries on moving off screen. so to fix this we have to track our point after it has dissapeared which should be impossible, except we have the option to offset our track! what this means is we can move the pattern and search boxes to anouther point in the clip and use them to maintain our motion. and as we are doing a linear 2d motion then the movementshould be consistent!

so, once you have tracked to the point where you lose your tracking point

you need to find another point in the frame to track that will act as a chiuld of the original track and allow you to continue onwards. once you think you have a good point, then you need to move ONLY the pattern box and search area of your tracking marker, the little dot of the track point must remain in its original position. to do this double tap the G key and move the pattern box.

then you can continue your track as normal. then repeat these steps to track the opposite direction and we are done, now jump back to the compositor and we can put it all together.


to use this node, you will need the video clip, actually you could in theory use a different clip as your main footage but that would have required some matchmoving skills that were not going into here! so first add a movie clip input node and open the same clip you just tracked, it should be available from the data block dropdown menu in the node, or just open it from the file. then we need an image that we want to place over the top, so add an image input node and open the image from your files.

we need to then connect them, as i am using an image with transparency i will coneect he image with an Alpha over nodemake sure premultiplied is checked to eliminate ant artifacts from your alpha channel.

now you’ll notice that there are no spaces to plug in the track position node, thats because we will need an additional couple of nodes to make this work. first open the add menu and select the distort sub menu and select the transform nodeand drop it inbetween the image node and the alpha over. this gives us a selection of importand inputs that we need. X, Y, Angle and Scale. so now we can connect our track position node x and y values in to the corresponding Transform values

then select the movie clip data from the track positions menu and you will see some more options appear, first we are asked for an object. this is thre tracking object that we used. as we just did a simple track we only have the default camera object in our menu so select that. then we need the specific track that we want to connect our image to. As we only have the one track on our clip we simply se;ect that track from the menu. if you had multiple tracks in the scene it would benifit you to rename the track in the motion tracking window to something relevent. in this instance though, it is track 001. 

the final option, is the position option, as we are just using a single point the absolute setting is what we want.

the three other options are absolute frame, relative frame and relative start. the relative values rely on having other tracking points in the scene to define the position of the image. absolute frame defines the position of the image according to its original position in the frame so it kind of over rides the tracking data a little bit and doesnt move us in the right way for what we need. the Absolute value pins the image directly to the value of the track so this is what we need.

however, as you can see, by setting up the track position node, our image has now jumped in the frame. this is because we have added the values of the x,y positions th the image so now it interperets this ans being elswhere in the scene. we need to move the image back to where we need it. To do this we need to reset the x and y values, as we no longer have access to the  value sliders in the transform node, we need a new node. As we only need the X and y values we can simply add a translate node to our tree, so open the distort sub menu again and choose translate. we can then just slide the x any y slider to bring the image back into position as we need.

at the moment the image is far to big so we need to reduce it down somewhat, so now we can look into our tranform node again and use the scale slider to bring our image to the size we like


Bring the image down to the right size then you’ll probably notice that it moves away from the center, thats ok , simply adjust the xy values on the translate node again until it is in position, and that is the job finished you can render this out and the image will follow the track and appear to be attached to the door.

Share this: