Posts Tagged ‘effect’

Tutorial – Light fog in After Effects – Part 2

Monday, November 12th, 2012

In part 1 of this tutorial, we went through rendering and setup of the composite for a scene with a light fog effect to be made in After Effects. Next we’ll take the 3D movement data from Maya and apply that to the CC Light Burst effect so that the light fog emanates from the right place.

For those of you who skipped the first part as you only want the tracking tutorial, the first thing you’ll need is a Maya scene. I’ll be working from the sample scene I provided in part 1 of this tutorial, but make sure your scene at least have the following:

• A camera with animation keys
• A locator snapped to the same position as the light source that emits the fog. (If you have multiple sources you want to track then have a locator for each one, but for the sake of this tutorial I’m only operating as if one is present.) If the light source moves, then be sure the locator moves with it (a point constraint works well for this).

Next, you’ll need to convert the camera and locator data into a format that After Effects can use:

• Rename your camera to ‘camera1’ and your null to ‘null1’
• Select your camera and locator, then go to Edit -> Keys -> Bake Simulation (use default options)
• With the camera and locator still selected, go to File -> Export Selection and export to an alternate version of this sequence. Be sure you set the format to ‘Maya ASCII’ (.ma).
• Open this .ma file to make sure everything appears right. Your scene should consist ONLY of the camera and locator. (If you use a camera with aim and such, the camera group and camera aim nodes are okay to have around; at this point they’re redundant, but they aren’t harming anything. Just make sure the camera itself is only receiving information from the animation keys after the simulation is baked.)

The next step is to bring this information into After Effects.

• Import the .ma file into After Effects. This should create a new composition with the name of the file you imported which contains a cameraShape1, a nullShape1, and any extraneous nodes (mine included a camera1_group node but I deleted it as it wasn’t doing anything).
• The camera and null1 will have animation keys for each and every frame. (Figure 7) Feel free to remove any keys that aren’t necessary. I’d leave the camera alone, but if your light source is completely stationary (ie: it’s the camera that moves, not the light or other tracked objects), there’s no sense in having After Effects process animation keys on the null1 node.
• Rename this composition to ‘tracking’


Fig. 7

Once you’re sure the composition works properly, it’s time to make it into something the After Effects tracker can use.

• Create a black solid that covers the entire composition. There should be no transparency present in the composition. Set it as the bottommost layer in this comp.
• Create a white solid and drop it into your scene. Hit your Toggle Switches / Modes button, make the layer 3D and set its anchor point to 0,0,0. Pick-whip the white solid layer so that it’s parented to follow your nullShape1 layer. Set its position to 0,0,0. (Figure 8 )
• By now the top-left corner of the white solid layer should be matched up with the top-left corner of nullShape1, however the white solid should look very large and, depending on your specific scene, be very blurry. This is because the nullShape1 is, by default, scaled way too large. Correct this by scaling it down to a very small number (my scene was set to around 0.1%). The end result should have the white solid look like a relatively small, crisp-edged square that will be easy to track. (Figure 9)


Fig. 8


Fig. 9

Now your composition should be set up such that the camera moves in 3D and the white solid appears to be a flat 2D plane facing “forward” (towards the camera, but at an angle depending on the camera’s position/rotation). Let’s use After Effects’ tracking tools to convert the position of the top-left corner of the solid (or more specifically, the position of the null1Shape node which matches the light source) into 2D information that can then be pumped into a 2D layer or effect.

• Drop your ‘tracking’ composition into ‘fogComp’. With the tracking layer selected, go to Animation -> Track Motion
• Drag the very center of your track point to the top-left corner of the white box. A square around the center point will show you a zoomed-in view to help ensure good placement.
• In the Tracker pane, click the forward button on Analyze to track the motion. Make sure you’re at the first frame of your composition (or where you would otherwise like the tracking to start). After Effects will move forward through the sequence and apply a keyframe to the tracker for each frame. (Figure 10)

Fig. 10

At this point you can hide the tracker layer. Now to link the Center of the CC Light Burst to this tracking data.

• Hit the drop-down menu on your adjustment layer, open the CC Light Burst effect, then hold the Alt key while hitting the stop watch next to the Center attribute
• Click the pick-whip on this expression menu and drag it to the Feature Center of your tracking layer’s Motion Tracker. (Figure 11)

Fig. 11

Now if you scrub through the timeline, you should notice that the Center attribute of your CC Light Burst effect is moving in place with the motion tracker. (Note that your computer may respond slowly; you can help improve performance by changing your Resolution to Half, Third, or even Quarter.) If you go back to your mainComp, this will map forward to the final composite. (Figure 12)

Again, this is a very specific application of this type of 3D -> 2D motion tracking, but there are tons of other uses for this. Want pop-up labels to move with the camera? Simulate sprites without dynamics? Fireflies in the background during a night scene? Go nuts!

I hope this was helpful. If you have any questions, please leave me a note in the comments section or shoot me an email at dbeach@dbeach3d.com. Thanks for reading!

Click here to return to the blog
Click here to go to the dbeach3d.com front page