Although the most popular pipeline to track a live action scene is to work in a dedicated 3d tracking system like Boujou, PF Track, Syntheyes and then export the camera to 3d application.
Not everyone, however, can afford these costly 3d tracking systems. For those, who have limited resources, they still can track the scene in After Effects and then export the tracking data to 3d application.
In this tutorial, I will show how to track a live action scene in After Effects and then exporting the camera data to 3ds Max.
1. Project Setting
Open After Effects.
Go to Composition > New Composition to make a new composition.
Alternatively, you can press Ctrl-N keys. It opens the Composition Settings window.
Set the Width and Height values to 1280 and 720 respectively.
Set the Frame Rate to 25 and Duration to 12 seconds. Click on OK.
Go to File > Import > File to import the image sequence. Alternatively, you can press Ctrl-I keys. With the first image of the image sequence selected, turn on JPEG Sequence option. Click on Open.
With the image sequence selected in the Project window, press Alt-Ctrl-G keys to open the Interpret Footage window. In the Interpret Footage window, set the frame rate to 25 and click on OK.
With the image sequence selected, drag and drop it inside the composition. You can see the footage in the comp view.
2. Camera Tracking in After Effects
With the image sequence layer selected, go to Animation > Track Camera.
The 3D camera tracker system starts analysing the footage. It analyses the footage in two steps.
After a couple of seconds, the analyse process ends. Now you can see several track points in the scene.
If the track points are too tiny, you can increase the value of Track Point Size in the 3D Camera Trackereffect.
These track points would help to generate the dummy 3D plane/null and the camera. You need to select at least four points to generate the helping dummy or layer.
Select several track points on the ground as shown in the following image.
With the points selected, secondary-click the mouse and select Create Null and Camera.
You get a null object and 3D camera in the timeline. This null object is the placeholder and sticks with the footage and follows the camera.
3. Exporting Camera Data to 3ds Max
Go to www.aenhancer.com and you will find that they have released a free script AE3D for After Effects. You can download the script from there.
Alternatively, the script has been supplied with the tutorial also. Just copy the script and paste it in theScript folder of After Effects.
Restart After Effects. Open the same composition again.
With the null object and 3d camera layers selected, go to File > Script > AE3D_Export.jsx.
In the AE3D window, select the 3ds Max option, set the file name to cameraand then click onExport. It saves the 3ds max script file on the desktop.
4. Creating Scene in 3ds Max
Open 3ds Max.
Go to MAXScript > Run Script.
Here select the camerascript which was exported from After Effects. Click on Open.
You get a 3d camera and one dummy in the scene.
In the perspective view, press C key for the camera view.
Right now the camera is upside down. You need to correct the coordinate of camera.
With the camera and dummy selected, group them together.
After grouping, jump in the left viewport. Select the Rotate tool and rotate it to the right side. Your goal should be to put the dummy on the grid line.
Adjust the dummy a little bit more to make it straight.
Jump in the camera view. Press Alt-B keys to open the Viewport Configuration window. Turn on Use Filesand Animate Background options. Click on Files.
Select the image, turn on Sequence option and click on Open.
Turn on the Show Safe Frame option in the camera view.
Alternatively, you can press Shift-F keys.
You can now make any 3d model and put it on the grid around the dummy. In my case, I have made a barrel model which I have imported into the scene.
At this stage, if you render the complete scene and play the video, you’ll notice sliding problem in the 3d object.
To overcome this problem, drag the grouped dummy and camera a bit down. You should put the dummy at half of the black grid line.
Put a plane beneath the 3d barrel. Apply Matte Shadow on to the plane.
Apply a Skylight in the scene. Turn on Cast Shadow option.
Render the frame and you will see the 3d barrel is perfectly merged with the scene. You can now render the whole sequence and when you play the video you will see the 3d barrel is perfectly matching with the live scene.
3D camera tracking system in After Effects is a great feature for 3D tracking. When it is combined with 3D application, it gives awesome results. I would try to bring some more interested tutorials based on 3D camera tracking.