How to Track 3d Objects in After Effects

Read Time: 5 mins Languages:

Preview

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

Step 1

Open After Effects.

Open After Effects Open After Effects Open After Effects
Open After Effects

Step 2

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.

Composition Settings Composition Settings Composition Settings
Composition Settings

Step 3

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.

File  Import  File File  Import  File File  Import  File
File > Import > File

Step 4

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.

Interpret Footage Interpret Footage Interpret Footage
Interpret Footage

Step 5

With the image sequence selected, drag and drop it inside the composition. You can see the footage in the comp view.

Image sequence Image sequence Image sequence
Image sequence

2. Camera Tracking in After Effects

Step 1

With the image sequence layer selected, go to Animation > Track Camera.

Animation  Track Camera Animation  Track Camera Animation  Track Camera
Animation > Track Camera

Step 2

The 3D camera tracker system starts analysing the footage. It analyses the footage in two steps.

3D camera tracker 3D camera tracker 3D camera tracker
3D camera tracker

Step 3

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 Tracker effect.

3D Camera Tracker 3D Camera Tracker 3D Camera Tracker
3D Camera Tracker

Step 4

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.

3D planenull 3D planenull 3D planenull
3D plane/null

Step 5

With the points selected, secondary-click the mouse and select Create Null and Camera.

Create Null and Camera Create Null and Camera Create Null and Camera
Create Null and Camera

Step 6

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.

You get a null object and 3D camera You get a null object and 3D camera You get a null object and 3D camera
You get a null object and 3D camera

3. Exporting Camera Data to 3ds Max

Step 1

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 the Script folder of After Effects.

AE3D AE3D AE3D
AE3D

Step 2

Restart After Effects. Open the same composition again.

With the null object and 3d camera layers selected, go to File > Script > AE3D_Export.jsx.

File  Script  AE3D_Exportjsx File  Script  AE3D_Exportjsx File  Script  AE3D_Exportjsx
File > Script > AE3D_Export.jsx

Step 3

In the AE3D window, select the 3ds Max option, set the file name to camera tracker.ms and then click on Export. It saves the 3ds max script file on the desktop.

camera trackerms camera trackerms camera trackerms
camera tracker.ms

4. Creating Scene in 3ds Max

Step 1

Open 3ds Max.

Open 3ds Max Open 3ds Max Open 3ds Max
Open 3ds Max

Step 2

Go to MAXScript > Run Script.

MAXScript  Run Script MAXScript  Run Script MAXScript  Run Script
MAXScript > Run Script

Step 3

Here select the camera track.ms script which was exported from After Effects. Click on Open.

camera trackms camera trackms camera trackms
camera track.ms

Step 4

You get a 3d camera and one dummy in the scene.

3d camera and one dummy 3d camera and one dummy 3d camera and one dummy
3d camera and one dummy

Step 5

In the perspective view, press C key for the camera view.

Camera view Camera view Camera view
Camera view

Step 6

Right now the camera is upside down. You need to correct the coordinate of camera.

Coordinate of camera Coordinate of camera Coordinate of camera
Coordinate of camera

Step 7

With the camera and dummy selected, group them together.

Camera and dummy Camera and dummy Camera and dummy
Camera and dummy

Step 8

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.

Rotate tool Rotate tool Rotate tool
Rotate tool

Step 9

Adjust the dummy a little bit more to make it straight.

Adjust the dummy Adjust the dummy Adjust the dummy
Adjust the dummy

Step 10

Jump in the camera view. Press Alt-B keys to open the Viewport Configuration window. Turn on Use Files and Animate Background options. Click on Files.

Viewport Configuration Viewport Configuration Viewport Configuration
Viewport Configuration

Step 11

Select the image, turn on Sequence option and click on Open.

Sequence Sequence Sequence
Sequence

Step 12

Turn on the Show Safe Frame option in the camera view.

Alternatively, you can press Shift-F keys.

Show Safe Frame Show Safe Frame Show Safe Frame
Show Safe Frame

Step 13

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.

3D Object 3D Object 3D Object
3D Object

Step 14

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.

Adjust the dummy and camera Adjust the dummy and camera Adjust the dummy and camera
Adjust the dummy and camera

Step 15

Put a plane beneath the 3d barrel. Apply Matte Shadow on to the plane.

Matte Shadow Matte Shadow Matte Shadow
Matte Shadow

Step 16

Apply a Skylight in the scene. Turn on Cast Shadow option.

Skylight Skylight Skylight
Skylight

Step 17

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.

Rendered frame Rendered frame Rendered frame
Rendered frame

Conclusion

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.

Uriel Deveaud

My name is Uriel Deveaud and I am a CG and VFX trainer at the Kolam Institute. Were I train students in FOSS (Free and open Source Software) like Blender, GIMP etc. My primary interests are in 3ds Max, After Effects, Fusion and Music.

How to Track 3d Objects in After Effects

Source: https://cgi.tutsplus.com/tutorials/3d-camera-tracking-in-3ds-max-using-after-effects--cms-27249

0 Response to "How to Track 3d Objects in After Effects"

Publicar un comentario

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel