Posts Tagged ‘maya’

New MEL script – dbInsertGrp

Friday, March 15th, 2013

I’ve mentioned in previous blog posts that I’ve been trying my hand at more MEL scripting lately.  This is the first of three posts about the new/updated scripts I’ve been working on that might help speed up your workflow.  First up is my Insert Group Tool.  This one’s pretty straightforward: it takes your selected objects and places them beneath a group node while maintaining the selected objects’ place in the scene heirarchy.  It can also let you specify whether you want the group’s pivot point to be at the scene’s origin, aligned with the first object in your selection, or centered on your selected objects.  The only thing to watch out for is that this tool does not account for objects that already have animation keys applied, so be sure to apply this during the rigging phase of your project.  Hope this helps!

Click here to download the dbInsertGrp script

Click here to return to the blog
Click here to go to the front page

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 Thanks for reading!

Click here to return to the blog
Click here to go to the front page

Tutorial – Light fog in After Effects – Part 1

Thursday, November 1st, 2012

I’ve had a lot of fun tinkering around with various tricks in After Effects to see how I could integrate them into my 3D renders. One visual effect I was trying to work with recently was light fog: the idea was to have a stationary prop placed in front of a bright light, only visible by its silhouette, with light fog casing around its shape. I know how to do this in Maya, however I wanted to do it in post due as tweaking the effect in the 3D software to get the desired look can require a lot of guesswork and be slow to render. The basic look is easy enough to accomplish in post with the CC Light Burst effect, except that although the prop itself was stationary, the camera itself moves in the Maya sequence: the center point of the light burst would have to move in 3D space, and CC Light Burst is a 2D effect. I was eventually able to get this work by taking locator and camera data from Maya, tracking that locator data, and then transferring the 2D coordinates from the tracker to the CC Light Burst effect.

Confused yet? I’ll start from the beginning.

This tutorial is split into two parts: the first part will focus on rendering and compositing your Maya scene for the light fog effect described above, and the second part will walk through how to take the 3D placement data from your Maya scene and track it using After Effects.

First, you need a Maya scene. I’ve provided a very basic scene with a cube, a bright mental ray area light, a polygonal ground plane, and a camera with animation keys. (Figure 1). I’ve also set up the proper render layers for this tutorial, though to understand the workflow I’d recommend deleting the render layers and following along. This workflow should work with any scene, but be sure you have the following as they’ll be needed for tracking in After Effects:

• A camera with animation keys
• A locator point-constrained to the light source (the point constrain is only necessary if the light source itself moves.Otherwise, snap the locator so it’s placed in the exact same position as the light). If you have multiple light sources or objects you want to track, you’ll need a locator for each one.

Fig. 1

With the scene ready, it’s time to set this up for rendering. For the light fog effect, you’ll need these three render layers:

• A beauty pass
• An RGB matte pass with the cube and ground plane assigned to different colors
• An RGB shadow pass that will serve as a matte for the light fog effect. This will be used to luma mask the CC Light Burst effect so that it doesn’t show in front of the cube within its shadow.

The beauty pass is simple enough. For this scene, the default masterLayer will suffice.

For the RGB matte, select the poly cube and the ground plane and assign them to a new render layer called ‘rgb_matte’. Assign a pure red surface shader to the cube and a pure green surface shader to the ground plane. (Figure 2) We’ll use this to key the box out in After Effects.

Fig. 2

The RGB shadow pass layer is a little tricky. I’ve had difficulty using Maya’s and mental ray’s shadow pass systems, however Jeremy Birn has a very excellent tutorial on the setup and merits of making an RGB shadow pass. The best workflow I’ve found is to duplicate the light source (rename it to some variant of ‘shadow light’ to avoid confusion), hide the primary light, turn off any decay that may be present (this is why we duplicate the light; you can’t use layer overrides for decay rate), apply Jeremy Birn’s workflow for making a shadow pass, and set the value of its shadow color to a very high level (I used 100). (Figure 3) The result should have very strong contrast between black and whatever primary color you choose, though the look can be tweaked in After Effects with color correction effects when we key the background out.

Fig. 3

With everything ready, batch render the sequence and bring those renders into After Effects. Make sure the alpha settings are set properly: the RGB shadow pass will need to have its alpha ignored to be properly luma keyed later. Drop the beauty pass into its own composition and name this composition “mainComp”.

We’ll be building a separate composition specifically for the fog effect. To start this, drop in the beauty pass. (We’ll only be using it as a visual guide and this will be hidden at the very end.) Rename this comp to ‘fogComp’. Next, drop in a white solid, then drop in the rgb_matte render. We’ll need to apply a Set Matte effect to the rgb_matte layer and set its ‘Use For Matte’ to red channel. Next, select the white solid and set its track matte to alpha. At this point, your composition should look like the beauty pass with an additional white box covering the cube. (Figure 4) If everything looks lined up properly, you can hide the beauty pass layer in fogComp.

Fig. 4

Next, we need to build the light fog effect. First, create a new adjustment layer and also drag on the RGB shadow sequence, placing it above the adjustment layer. Apply a Set Channels effect to the RGB shadow layer and set all color sources to whatever color channel you set as the shadow color in Maya (in my case, green). Then, select the adjustment layer, set its track matte to Luma Inverted, and apply a CC Light Burst effect. Tweak the Intensity and Ray Length as desired. The result should have the white cube visible with light fog extending around its edges, except for where its shadow on the ground plane would be obstructing it. (Figure 5)

Fig. 5

Everything looks good so far, however the light fog should be going around the box; the box itself shouldn’t be lit. To fix this, drag on a black solid and the RGB matte. Re-apply the Set Matte effect to the RGB matte layer like we did a few minutes ago to isolate the red cube, then apply this as an alpha track matte to the black solid we just placed. There should now be a black ‘cutout’ where the box was, however there may be a thin white line going around the bottom edge of the box. To fix this, go down to the rgb matte layer that’s affecting the white solid layer and apply a Minimax effect, setting its operation to Minimum, its radius to 1, and the channel to Alpha. This should remove the thin white line. (Figure 6)

Fig. 6

From here you can tweak the look of the light fog. For starters, you can add a Levels effect to the RGB shadow layer to adjust the spread of the light fog onto the ground plane, or you can apply some Gaussian blur effects to the RGB matte layers to soften the edge of the fog.

Now to apply this light fog effect our mainComp. Go to mainComp and drop the fogComp on top of it, sending its blend mode to Screen. If you scrub through your timeline you should now have the silhouette of the cube with light fog being cast from its edges, however there’s no directionality to the light fog: it’s always being emitted from the very center of the composition. For stills or sequences with minimal camera movement you can move the Center attribute of the CC Light Burst effect and be done with it, but for complex sequences or animations where the camera moves a lot this may not be practical.

In the next part of the tutorial, we’ll go over how to take the animation data already in Maya and apply that to a 2D effect in After Effects. If you have any questions about this part of the workflow, shoot me an email at or leave a note in the comments section. Thanks for reading!

Click here to return to the blog
Click here to go to the front page

Learning resources – Lighting and Rendering

Saturday, April 9th, 2011

Since November I’ve been working at Static Control Components as a 3D animator. I can’t go into gross detail about what I do (confidentiality agreements and all that), but the short version is that I’m demonstrating technical processes involved with laser printers, including many that happen on a microscopic level. Given that my studies while at UGA and SCAD were focused on character setup/technical direction, this was a bit of a change of pace, and I’ve had to learn a lot while on-the-job.

Fortunately, I’ve had access to plenty of research material. I’ve read through textbooks I own that’ve gathered dust from not being read in a while (if at all), taken tons of notes, and watched dozens of hours of tutorial videos. In doing so I’ve learned a lot about areas I previously had a weak grasp on: MEL scripting, render management, compositing, post-production cleanup, particles, and others. I wouldn’t say I’ve got an expert command on those areas yet, but I’ve really been able to round-out my “jack of all trades” skill set.

As I can’t really post samples of what I’ve been working on (again, confidentiality agreements), I’ll instead talk about some of the books and DVDs I’ve been studying. I’m also going to update my blog periodically with some of the tricks and processes I’ve learned.

First and foremost, I cannot recommend Digital Tutors enough. They’ve been in the digital learning business for a while, and
over the past few years they’ve shifted their business model so that all of their tutorials are available streaming online. It’s a subscription-based model, and while it isn’t particularly cheap (as subscriptions for streaming content go), it’s well worth every penny. If you’re the type who likes to study new things constantly, it can work out to be a lot cheaper than buying the textbooks.

My next recommendation is for Jeremy Birn’s Digital Lighting and Rendering. This goes into great detail on how lighting in 3D works, and as it’s not specific to any particular animation package it’s a valuable resource to absolutely anyone. He also has a separate DVD that’s Maya-specific, and I’d strongly recommend that to anyone junior to intermediate-level; it covers many of the same concepts as his book, but seeing how he sets things up in real-time makes it very easy to follow. He also demonstrates a bunch of useful tips hidden in the Maya interface that’re easy to miss but make for excellent timesavers.

Along similar lines, Lee Lanier’s Advanced Maya Texturing and Lighting is another book I’ve referenced time and time and time again. This one focuses more on Maya shading networks, but it also has a few chapters on general color and lighting theory.

One thing that surprised me with Maya is how much useful information is in the actual documentation: when in doubt, read the freakin’ manual. Not sure how a particular process works? Open the Help menu and load up the Tutorials. Want to know what all the sliders do for a given command? Check the Node and Attribute Reference. Does MEL frighten and confuse you? There’s a MEL command reference built right in to the program. While none of these are quite as intuitive or easy-to-follow as a dedicated book on a given subject, the documentation will give you enough of a crash course to at least dabble.

As I haven’t really had that many independent projects going on outside of work, I’ve decided to use this blog to post about any useful resources I find or 3D tricks I discover. I’ve already got ideas for some future posts, so with any luck I’ll be able to update this regularly. Thanks for reading!

Click here to return to the blog
Click here to go to the front page

New BasicGuy posted on Tim Oberlander’s blog

Thursday, June 3rd, 2010

Tim Oberlander recently updated his BasicGuy rig to version 3.3.1. I first used BasicGuy in a character animation class at SCAD (it quickly became a favorite of the entire class), and to this day it’s still my favorite rig. It looks like the new version revamps the BasicGuy GUI scripts; the GUI now has much more advanced functionality built into it, and the FK/IK snapping workflow has been simplified. I’ve been thinking of doing some more character animation work lately so I’ll probably give it a spin myself soon enough. Check it out!

Click here to go to Tim Oberlander’s blog

Click here to return to the blog
Click here to return to the front page