Compositing: Get mask of glass/ transparent materials I'm using the compositor to automatically segment parts of objects into masks. This works well for most materials, but when doing the same for a mix shader of glossy and transparent it doesn't, how to fix this? 

An example of what one of multiple masks looks like:


A possible reason (I tested whether there are any very light grey values, the output is a solid white):


On a sidenode: The same thing happens when I use materialIDs.

The current node setup:


The file is too big for the official uploader; I hope dropbox doesn't deter you. 
https://www.dropbox.com/s/alv6jq6vnvshgzs/stack.blend?dl=0

You'll have to set the output path and should then be able to reproduce by pressing render.
You need to set Alpha Threshold to 0, then all materials will be equally solid as ID Masks. Don't know what you're after with the set alpha nodes, but they don't do anything in this node setup so you can skip them.