How to hide a mesh on render, but keep hiding polygon it was hiding? I'm using blender to render sprites for a game.
I have a character mesh, and a T-Shirt mesh, rendered with a transparent background.


I want to render the T-Shirt without the character, disabling the character I get this:


How to make the polygons that were hidden by the character transparent?
Set the pass index of the shirt to 1 (material tab>settings>pass index). Enable material index for the render layer (render layers tab>passes>material index). Go into the compositor (top bar where it says default, change it to compositing). Select use nodes and set up this node setup:

For the top image input on the Alpha Over node set A: to 0.