The logo was rendered in a 3D program; the walls were created in After Effects. Both use the same camera data, so their perspective shifts match as the camera moves.
Many 3D artists use After Effects as a finishing tool: tweaking colors, improving the composite, and blending other layers such as greenscreen footage into the final scene, with the goal of creating a realistic image. By contrast, our primary focus is creating abstract motion graphics, so for us the tables are turned: We use 3D programs (most often Maxon Cinema 4D plus Zaxwerks Invigorator and ProAnimator) almost as utilities, to create elements to integrate into our purely graphical worlds.
In the old days, this process was somewhat separated, limiting what we could do: For example, a dramatic camera move in 3D would often look silly composited over a stationary 2D scene unless you did a lot of work to approximate the shifts in perspective. However, ever since After Effects gained its own concept of 3D space back in version 5, it has become much easier to tie these two worlds together, keeping the same shifts in perspective for both 3D and After Effects elements. For example, we might create, texture, and animate a logo in 3D, and then composite other 2D elements around it in After Effects.
Many roads to the same place
The key to integrating 3D elements with other layers created in After Effects is to recreate the original 3D camera animation – this way, all layers can have the same perspective distortion as the camera moves. As it turns out, there are almost as many ways to bring camera data from a 3D application into After Effects as there are 3D applications.
For example, if you save a Maya project to the .ma format (Maya ASCII), you can import it as a project in After Effects, resulting in a composition being created with a matching animated camera. You can also export a camera move from Electric Image to this format. If you save to the .rpf (Rich Pixel Format) from 3d studio max, you can run a Keyframe Assistant on the resulting sequence in After Effects to create an animated camera.
Maxon’s Cinema 4D has the most comprehensive solution, allowing you to export a Cinema project to a special .aec (After Effects Composition) file, which can then be imported into either Standard or Pro versions of After Effects with a free plug-in provided by Maxon. In addition to an animated camera, you will also get lights as well as individual layers for different surface properties of the Cinema render. In other programs such as Softimage XSI, you may need third-party scripts or utilities to export a text file which can then pasted in as camera keyframes inside After Effects.
In most cases, “world units” in your 3D program match pixels in After Effects; you may need to scale layers up or down to match. Make sure you write down your original 3D camera’s Angle of View and check that the resulting After Effects camera matches. Also make sure that you don’t slide the range of frames you rendered in relation to the frames of camera data you exported, or your moves won’t line up.
Combining worlds
What may not be intuitive is that in After Effects, your 3D render is the one layer you must leave in 2D space: It already has perspective changes from the original camera animation “baked” into it; there is no need to render additional perspective changes for it inside After Effects. When you add layers in After Effects that are supposed to have perspectives that match your 3D render, enable the 3D Layer switch for these new elements so that they will respond to the camera move you imported.
In the project illustrated at the top of this page and to the left (it’s a 7.4 meg movie, so will take a few moments to load after accessing this page), we created interesting multilayered imagery in their own nested comps, masked the result, and positioned them in 3D space in After Effects to create the effect of abstract sculpture or walls in an art gallery. It was much faster to tweak these walls in After Effects than in the 3D program that the logo was rendered in. The Bevel Edges effect gives them the appearance of thickness, even though the walls themselves are 2D objects. If you want to go one step further and make the Bevel Edges effect appear to follow an animated 3D light, you can add the following expression to this effect’s Light Angle parameter:
angle_offset = 90 + rotation;
target_layer = this_comp.layer(“My_Light”);
rel_pos = sub (position, targer_layer.position);
(Math.atan2(rel_pos[1], rel_pos[0]) * 180/Math.PI) – angle_offset
We enabled the ability for these new layers to cast and receive shadows; as the camera moves around them, their shadows appear to shift. The already-rendered logo was then placed on top. To make the logo – now a 2D layer – appear to cast shadows onto the 3D layers added in After Effects, we applied the Radial Shadow effect to the logo, and manually animated its light position to make its shadow move as well.
Splitting the creation of the objects across two programs proved to be more flexible for this job, rather than restrictive. Once a first pass of the logo had been rendered and camera data recreated, one of us could work on the After Effects project while the other continued to massage the logo in 3D. As long as the camera move itself did not change, the new logo render would drop straight into the After Effects project with no problem. If the camera move did change a little (such as adjusting the ease in and out for the move), it was still a fairly simple matter to pass the new camera data along with the new logo render.
Postscript: More information on 3D integration
If this column has whetted your appetite on the subject of integrating 3D programs with After Effects, we wrote quite extensive chapters on the subject in Creating Motion Graphics Volume 2
The content contained in our books, videos, blogs, and articles for other sites are all copyright Crish Design, except where otherwise attributed.