Antialiased Object / Material alpha?

Is there anyway to generate an a nice antialiased object or material alpha?

I’ve learned two ways of rendering an alpha for an object or material.

Both used nodes in the Compositing tab. One used the ID Mask Node and the other used z-index or render pass.

But both alpha outputs were hard edged bitmaps with no antialiasing, even when antialiasing was selected for one of the alpha outputs.

(Blender 2.77a, Mac Pro early 2008, GTX780, 32Gb RAM)

A discrete value like ID can not be antialiased because each pixel can have one value only and interpolating them is meaningless. If you need antialiased mattes you can render them as separate renderlayers and use alpha as matte or supersample the ID passes - render them in higher resolution, pull the mattes and downscale the mattes to comp resolution.

Thanks. I’ll give this a go. This solution might work with another answer I found that overrides and randomises the material colour in a scene and renders them flat. From which I think you could easily generate masks for a complicated scene in an image editor.

Richard Merklew posted a suggestion here, using a random node, colour ramp and emission node to generate a multi colour, material ID-like output from which you could lift object masks in an image editor.

His screen grab is below.