Latest Blog Posts

Learn HitFilm & Imerge

Learn editing techniques, how to use HitFilm effects and more with these short videos

How to use CamTrackAR with Unreal Engine, Blender, and After Effects

In the final installment of our CamTrackAR Masterclass, we're taking you through how to apply CamTrackAR tracking data to CG backgrounds in software such as Unreal Engine, Blender, and After Effects so they can be exported and composited in HitFilm.

Welcome back to another episode of our CamTrackAR Masterclass. In the previous tutorials, we had shown you how to film a scene using CamTrackAR, the benefits of the paid vs. free version, and how to take your footage and composite it in HitFilm using a pre-rendered CG background. In this tutorial, we’ll walk you through how to take your CamTrackAR data and apply it to your CG background so you can composite it in HitFilm.


How to use your CamTrackAR data in Blender

How to use CamTrackAR with Unreal Engine, Blender, and After Effects - Importing data to Blender

In order to use CamTrackAR data in Blender for the first time, you’ll need to install a plugin – this only has to be done once:

  1. First, navigate to Edit > Preferences > Add-Ons.
  2. Select Install, then navigate to the CamTrackAR folder
  3. Select the Python file and install. 
  4. Lastly, ensure that “Enabled Add-ons Only” is ticked.

Our scene was made using assets from Video Copilot’s Star Pack and Sketchfab for the mountain. To import the CamTrackAR data go to File > Import > HitFilm AR Tracking Data. Next, find the take you want and select the .hfcs file. Lastly, select the layer and hit 0 on your keyboard to view the scene from your Camera’s perspective – now, your virtual camera should match the camera’s movements when filming on set.

How to use CamTrackAR with Unreal Engine, Blender, and After Effects - Viewing footage in Blender

It’s unlikely that the camera is positioned correctly; You can fix this by adjusting the Delta Transform in the settings on the right. This will move the camera but maintain the tracking data. One thing that might be useful is to be able to see your video footage. To do that, go to the Object Data Properties tab and checkmark Background Images. Select Add Image, change the Background Source to Movie Clip, then open the video file. Lastly, change the Depth to Front to have the video in front of your 3D scene.

Before you export your background, check the Output Properties and make sure everything is correct, including the frame rate. We changed the resolution to 2560 by 1440 as CamTrackAR records at 1920 by 1440. This means that our 3D render needs to match the height of 1440 plus have extra on the sides to maintain the 16:9 aspect ratio.

When you are happy with your scene, pick the folder it’ll be exported to; in this case, it’s exported as a PNG sequence. Then come up to Render and select Render Animation. 


How to use your CamTrackAR data in Unreal Engine 4

How to use CamTrackAR with Unreal Engine, Blender, and After Effects - Importing data to Unreal Engine 4

Now let’s learn how to use the tracking data in Unreal Engine 4, which is also free. In our example, we used a Polar Facility map, which is available on the Epic Games Marketplace

To open the Sequencer timeline, navigate to Cinematics and select Add Level Sequence. Once opened, come over to the Actions icon, select Import, and navigate to the CamTrackAR folder – the FBX file is the one we want. Uncheck everything except Create Cameras and hit Import. Lastly, be sure to change the fps to 60 as it may default to 30.

Upon import, you’ll want to extend the view range with the numbers at the bottom of the interface, move the Out point (which is the red line) and extend the length of the Camera itself to cover the whole timeline. The camera-shaped button beside Camera Cuts will lock the viewport to the camera’s perspective so that you can see the movement. Like we did in Blender, we’ll want to move the camera’s position to be in the correct spot. To do so:

  1. Drag an Empty Actor into the scene and 0 out its Position in the Details panel. 
  2. In the World Outliner, drag the ARCamera on top of the Empty Actor to parent the former to it. This allows you to use this Empty Actor to move the camera around and maintain the tracking data. 
  3. Lastly, align the Actor with the floor of the scene.

With your camera properly positioned, you can begin to export the scene:

  1. Select the ARCamera and come into the Details panel. 
  2. Change the Filmback value to 48 height and 27 width- this matches the 16:9 aspect ratio we’ll be going with in the composite. 
  3. Click the Render button in the timeline, leave it as an AVI but change the resolution to 2560 by 1440 to maintain a 16:9 aspect ratio. 
  4. Then click Capture Movie and the scene will be exported.

How to use your CamTrackAR data in After Effects

How to use CamTrackAR with Unreal Engine, Blender, and After Effects - Importing data to After Effects

For import into After Effects, what you’re going to want to do is simply go to File > Scripts > Run Script File and open the .jsx file to create a new composition with the footage imported as well. Now you’ll have your footage and your tracked camera on the timeline – any anchor points will appear as null objects.

We hope you have enjoyed this CamTrackAR Masterclass. If you haven’t already, be sure to check out the other tutorials in the Masterclass (How to get started with CamTrackAR and How to composite CamTrackAR tracked footage in HitFilm) as well as the app for free on the iOS App Store. See you next time!

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on reddit
Reddit
Hannah Odebode

Hannah Odebode

Hey! I'm Hannah, the intern! I'm the person that gets to answer all of your questions and respond to your lovely comments on our socials. I have a great love for all things thriller/horror-film related and my favorite film as of yet is Parasite. ????
Hannah Odebode

Hannah Odebode

Hey! I'm Hannah, the intern! I'm the person that gets to answer all of your questions and respond to your lovely comments on our socials. I have a great love for all things thriller/horror-film related and my favorite film as of yet is Parasite. ????