After Effects – Camera Lens Blur effect

Software:
After Effects CC 2019

Untitled-2

Adobe After Effects has a very effective Camera Lens Blur effect that is capable of efficiently faking DOF (Depth Of Field) and Bokeh visual effects for 3D rendered images and animations, and also animate a fake “Focus-Pull”.

The effect will work best on 32 bit float EXR files, and requires a Z depth render element (pass/AOV) to be rendered with the main RGB image, and supplied as the Blur Map layer.

Tip:
If necessary, color correct the Z depth image so that the Black to White range will reflect the wanted focus range, and that the closest depth will be Black, blending into White at the furthest depth.

Example of a Z Depth image:Buddha_Z0.jpg

Untitled-3

Radius:
Controls the blurriness

Shape:
Choose the lens iris shape (number of blades) to design the Bokeh effect

Blur Map:
Defines a black & White Depth Layer (Z Depth) where black is the closes point to the camera and white is the furthest.

Blur Focal Distance:
Values of 0.0 to 1.0 will have the black through grey to white areas of the Blur Map remain at focus (sharp)

Highlight > Gain:
Intensify the highlights to create a more dominant Bokeh effect

 

Untitled-2.jpg

 

Related:
DOF in Arnold for Maya

Exporting 3D camera data from After Effects to 3ds max

Software:
After Effects 2020

  1. Download the AE3D_Export script here:
    http://www.urbanspaceman.net/shared/AEscripts/AE3Dexport/AE3D_Export.jsx
  2. Perform 3D tracking on the footage if necessary.
  3. Select the 3D Camera layer and also Null layers if available.
  4. Choose File > Scripts > Run Script File and locate the AE3D_Export script.
  5. In the Script parameters highlight 3ds max.
  6. Click Options and set the scale.
    * you might need to try and see the scale in 3ds max to set it right.
  7. Set a name for the exported ms (MaxScript) file.
  8. Click Export.
    The resulting MaxScript file will appear on the desktop named <your after effects project name>.ms
    Note:
    You may be prompted to check the Allow Scripts to Write Files and Access Network option in File > Preferences > Scripts & Expressions.
  9. Drag the generated MaxScript file into the 3ds max viewport.
    The script will run and create an animated Camera and Dummy object, and also set the timeline range to fit the animation.
  10. Create a new Point Helper object.
  11. Align the new Point Helper to the Dummy object in both position and orientation.
  12. Group the Camera and the Dummy objects together, and link the group to a new Point Helper.
    This will allow for easy orientation and scaling.
  13. Set the Point Helper object’s rotation to default (0,0,0) , this will also reset the Dummy + Camera group’s orientation relative to the world.
    Scale the Point Helper object if needed, to scale the whole camera setup.
  14. Display the original video sequence as viewport background to check how the camera motion fits the video.
    The center of your Point Helper should appear “glued” to a specific point in the background video. 
Untitled-2

 

Related:
After Effects 3D Camera tracking

3D Tracking in After Effects

Software:
After Effects 2020

  1. Select the footage layer in the composition and choose:
    Animation > Track Camera.
    * A 3D Camera Tracker effect will be applied to the layer, tracking will be processed, and when finished tracking points will be displayed.
  2. Hover over the tracking points and click to select a planar position, a location where the round icon is placed between 3 planar tracking points.
    * If you don’t see the tracking points make sure the 3D Camera Tracker effect is highlighted in the layer’s Effect Controls.
  3. Right click and choose Create Null and Camera.

Related:
Export 3D camera data to 3ds max

Extracting image layers from a multi-channel EXR file sequence in After Effects

Software:
After Effects CC 2018

  1. Apply an EXtractoR effect on the layer.
    * Effects > 3D Channel > EXtractoR
  2. In the EXtractoR effect parameters, Click the RGB Channels to open the EXtractoR dialog box.
  3. Choose the wanted layer from the Layers drop-down, or select individual channels from the B, G, B, Alpha drop-downs.

Note:
The Layer will be displayed darker than the original EXR main layer display because it will not be Gamma corrected (linear display).
A Gamma correction should be applied on the result of the composite via an adjustment layer or ‘pre-comping’ the layers and applying it on the containing composition.
* A Gamma correction can be applied using a Levels effect.
* In most cases the Gamma correction need to be with a value of 2.2 (sRGB).

Untitled-1.jpg