Compositing motion tracked footage - Exporting on transparent background

Hi guys, I’ve run into a problem while exporting an animation that I motion-tracked to imported footage. The basic idea is to export all the elements created in Blender (all objects, shadows, ambient occlusion) on an alpha channel so that I can composite them onto footage in After Effects. I’ll be compositing them onto the same footage I took the track from using Blender, but would rather do the compositing in After Effects for a few different reasons.

However, I can’t work out a way to export the animation with a transparent background. All my attempts end with the either a solid white background or the original movie clip in the background. Is there a way to replace the movie clip background or white space with solid transparency, so that I can overlay the other elements later?

Sorry if that doesn’t make a lot of sense, it’s a little tricky to explain. Here’s the blend file, and here’s a screencap of my compositor in Blender.
The compositor pictured here is untouched since I started working on the scene.

I’d really appreciate some help on this, I’m planning on using Blender a lot more for filmmaking if I can get this right. Is there something obvious I’m missing?

Cycles? If so in the render panel under “Film” check Transparent, that will remove any background images, HDRIs and such.
Are you outputting to a video format or to an image sequence? If a sequence, recommended, be sure the format supports alfa channels.

Or you could always green screen it and key it out in AE.

Thanks for the quick reply! I’m not using cycles, just the internal renderer. I’m exporting PNGs and have enabled alpha channels, so that shouldn’t be a problem. I also can’t key out a colour as I’m relying on semi-transparent shadows to sell the effect, and keying never looks as good as I want it to anyway. Still, thanks for the suggestions.

I’ll download the blend tomorrow if I have time and look at your set up.
In the mean time have you checked Blender Guru?
I think there is a tutorial over there for motion tracking that used BI.
It would have been composited in Blender as well but you may be able to get some questions answered that way.

If you want to composite it in AE, you will need to save 3 image sequences:

  • the undistorted clip pngs
  • your blender render pngs
  • the shadow/AO pngs


the 3 file output nodes in the green box will do that for you… you will want to change directories for each seq of course.

the blue box will show you what it would look like composited in blender ( you could set your render settings to a movie format and get a ‘free’ sample clip while generating the image sequences for AE ) the yellow node was just to give a background to the render to show the shadows… mute or delete it since you have the clip

The red box shows you the subtle effects of shadow/AO on your objects (just mute/unmute the orange node to see the difference) note that the shadows will not show up (or be saved) in the fully transparent areas… this is why you need the shadow/AO seq for AE.

Good point about the shadows in transparency Gpaprmh. Wish I could vote your comment up!