1 Render Layer; tube with shape key to be used as mask for “Halo” render layer.
Sky; Sky only in case it is to be animated in post.
Halo; Halo spot lamp in scene.002 (second scene). This renderlayer can “See” the monkey head but it can not render it because the layer is set to only render halos via the render layer tab, therefore only the volumetric light and the shadow from the head are rendered.
Monkey; Monkey head only. Render layer is set to only render solid objects.
Sky has it’s own set alpha node in case the background is to be faded out.
Nodes in order from left to right:
The halo render layer is plugged into a set alpha node and gets set to the alpha from Tube render layer. This is how the light gets masked. There are other ways to do this which are sometimes necessary but this is the easiest and most straight forward.
Mix node set to multiply lets us change the color of the light without having to re-render the layer.
Mix node set to add allows us to brighten things up a bit without having to play with material(alpha) settings for the tube in the scene. This is much faster than continually re-rendering to dial things in.
Blur node. This is our special little friend for dealing with problem alpha channel artifacts. Disconect the Mix node from it’s input socket and plug it into the alpha over node that the blur node is plugged into. That’s hideous isn’t it? Now reconnect things back the way you found them, then turn off the Bokeh button on the blur node. The resulting halo doesn’t really look bad in this case but it does look Wrong. Massive amounts of highlights appear in the shadows, exactly where they should not be. Bokeh doesn’t remove this entirely but it does smooth it to within acceptable limits. Notice also that there is actually a blur value of zero applied in both the x and y directions. I’m not sure why or how this works other than the bokeh filter is circular and as long as the size value is set to a number greater than zero then it works. I use it religiously.
Alpha over node applies the halo setup over the monkey head. This is not totally accurate but I promise that your viewers will never notice the difference.
Second alpha over node places the sky behind the halo/monkey setup. Now switch the order of the "Convert buttons on these two alpha over nodes. Bam! There it is. Sometimes you just gotta play with stuff until something works or keep playing after it’s working just to see what will happen. Sometimes you just get licky like I did here. I had no idea that would completely remove the halo untill I tried it just to see what the result would be.